/* ============================================
   FENUA CHAT - NOTIFICATION SYSTEM v4.8.1d
   Panel + Toasts + Animations
   ============================================ */

/* ===== NOTIFICATION BACKDROP ===== */
.notification-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.2s ease;
}

.notification-backdrop.active {
    display: block;
}

/* ===== NOTIFICATION PANEL ===== */
.notification-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-card-dark, #1a1a1a);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-panel.active {
    right: 0;
}

/* ===== PANEL HEADER ===== */
.notification-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 188, 212, 0.2);
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.1) 0%, rgba(0, 188, 212, 0.05) 100%);
}

.notification-panel-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-dark, #fff);
}

.notification-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notification-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* ===== PANEL ACTIONS ===== */
.notification-panel-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 188, 212, 0.1);
}

.notification-action-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(0, 188, 212, 0.1);
    border: 1px solid rgba(0, 188, 212, 0.3);
    border-radius: 8px;
    color: #00bcd4;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.notification-action-btn:hover {
    background: rgba(0, 188, 212, 0.2);
    transform: translateY(-2px);
}

.notification-action-btn.danger {
    background: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.3);
    color: #f44336;
}

.notification-action-btn.danger:hover {
    background: rgba(244, 67, 54, 0.2);
}

/* ===== NOTIFICATIONS LIST ===== */
.notifications-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.notification-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-light, #999);
}

.notification-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 188, 212, 0.2);
    border-top-color: #00bcd4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== NOTIFICATION ITEM ===== */
.notification-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: rgba(0, 188, 212, 0.05);
    border-left: 3px solid #00bcd4;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: slideInRight 0.3s ease;
}

.notification-item:hover {
    background: rgba(0, 188, 212, 0.1);
    transform: translateX(-5px);
}

.notification-item.unread {
    background: rgba(0, 188, 212, 0.15);
    border-left-width: 4px;
}

.notification-item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.notification-item-icon {
    width: 32px;
    height: 32px;
    background: rgba(0, 188, 212, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00bcd4;
    flex-shrink: 0;
}

.notification-item-info {
    flex: 1;
    min-width: 0;
}

.notification-item-type {
    font-size: 0.85rem;
    font-weight: 600;
    color: #00bcd4;
    margin-bottom: 0.25rem;
}

.notification-item-date {
    font-size: 0.75rem;
    color: var(--text-light, #999);
}

.notification-item-message {
    font-size: 0.9rem;
    color: var(--text-dark, #fff);
    line-height: 1.4;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== ANIMATION PING CONVERSATION ===== */
.conversation-item.conversation-ping {
    animation: conversationPing 1s ease-out;
}

@keyframes conversationPing {
    0% {
        transform: scale(1);
        background: rgba(0, 188, 212, 0.1);
    }
    25% {
        transform: scale(1.02);
        background: rgba(0, 188, 212, 0.3);
    }
    50% {
        transform: scale(0.98);
        background: rgba(0, 188, 212, 0.2);
    }
    75% {
        transform: scale(1.01);
        background: rgba(0, 188, 212, 0.15);
    }
    100% {
        transform: scale(1);
        background: transparent;
    }
}

/* ===== NOTIFICATION BELL ANIMATION ===== */
.notification-bell-container {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
}

.notification-bell {
    width: 24px;
    height: 24px;
    color: var(--text-dark, #fff);
    transition: all 0.3s ease;
}

.notification-bell-container:hover .notification-bell {
    color: #00bcd4;
    transform: scale(1.1);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #f44336;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.notification-bell-container.has-notifications .notification-bell {
    animation: bellRing 0.5s ease-in-out;
}

@keyframes bellRing {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: rotate(-10deg);
    }
    20%, 40%, 60%, 80% {
        transform: rotate(10deg);
    }
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .notification-panel {
        width: 100%;
        right: -100%;
    }
}

/* ===== DARK MODE ===== */
body.theme-dark .notification-panel,
body.dark-mode .notification-panel {
    background: #0a0a0a;
}

body.theme-dark .notification-panel-header,
body.dark-mode .notification-panel-header {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.15) 0%, rgba(0, 188, 212, 0.08) 100%);
}
/* ============================================
   NOTIFICATIONS SYSTEM - Styles
   ============================================ */

/* IcÃ´ne cloche */
.notification-bell-container {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s;
}

.notification-bell-container:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notification-bell {
    width: 24px;
    height: 24px;
    color: white;
}

/* Badge compteur */
.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #dc2626;
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Animation cloche quand notifs */
.notification-bell-container.has-notifications .notification-bell {
    animation: bellRing 2s ease-in-out infinite;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    5% { transform: rotate(15deg); }
    10% { transform: rotate(-15deg); }
    15% { transform: rotate(10deg); }
    20% { transform: rotate(-10deg); }
    25% { transform: rotate(5deg); }
    30% { transform: rotate(-5deg); }
    35% { transform: rotate(0deg); }
}

/* Backdrop */
.notification-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.notification-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Panel volet */
.notification-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: #1a1a1a;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.notification-panel.active {
    transform: translateX(0);
}

/* Header du panel */
.notification-panel-header {
    padding: 20px;
    background: linear-gradient(135deg, #00bcd4, #0097a7);
    color: white;
    flex-shrink: 0;
}

.notification-panel-header h2 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.notification-panel-actions {
    display: flex;
    gap: 10px;
}

.notification-panel-actions button {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.notification-panel-actions button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Bouton X de fermeture */
.notification-panel-close {
    background: transparent !important;
    color: white;
    border: none;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
    margin-left: 8px;
}

.notification-panel-close:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: rotate(90deg) !important;
}

/* Liste des notifications */
.notification-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 15px;
    margin-bottom: 10px;
    background: #252525;
    border-radius: 12px;
    border-left: 4px solid #00bcd4;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.notification-item:hover {
    background: #2a2a2a;
    transform: translateX(-5px);
}

.notification-item.unread {
    background: #2d3748;
    border-left-color: #f59e0b;
}

.notification-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    padding-right: 40px; /* Espace pour bouton supprimer */
}

/* Nouveau : Label type de notification */
.notification-type-label {
    color: #00bcd4;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.notification-item.unread .notification-type-label {
    color: #f59e0b;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.notification-header strong {
    color: #00bcd4;
    font-size: 14px;
}

.notification-time {
    color: #888;
    font-size: 11px;
}

.notification-message {
    color: #ddd;
    font-size: 13px;
    line-height: 1.5;
}

.notification-dot {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 10px;
    height: 10px;
    background: #f59e0b;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
}

/* Bouton supprimer individuel */
.notification-delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(220, 38, 38, 0.1);
    border: none;
    color: #dc2626;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0;
    transform: scale(0.8);
}

.notification-item:hover .notification-delete-btn {
    opacity: 1;
    transform: scale(1);
}

.notification-delete-btn:hover {
    background: rgba(220, 38, 38, 0.2);
    transform: scale(1.1);
}

.notification-delete-btn svg {
    width: 16px;
    height: 16px;
}

.notification-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s;
}

.notification-delete:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #dc2626;
}

/* Actions pour demandes d'ami */
.notification-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.notification-actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-accept {
    background: #10b981;
    color: white;
}

.btn-accept:hover {
    background: #059669;
}

.btn-decline {
    background: #6b7280;
    color: white;
}

.btn-decline:hover {
    background: #4b5563;
}

/* Empty state */
.notification-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.notification-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ============================================
   CHANNELS SYSTEM - Styles
   ============================================ */

.channels-container {
    padding: 20px;
}

/* Breadcrumb */
.channels-breadcrumb {
    padding: 15px;
    background: #252525;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #888;
    font-size: 14px;
}

.channels-breadcrumb span {
    color: #00bcd4;
}

/* Search bar */
.channels-search {
    position: relative;
    margin-bottom: 20px;
}

.channels-search input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    background: #252525;
    border: 2px solid #333;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    transition: all 0.3s;
}

.channels-search input:focus {
    outline: none;
    border-color: #00bcd4;
    background: #2a2a2a;
}

.channels-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

/* Search results */
.channels-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #252525;
    border-radius: 10px;
    margin-top: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-height: 300px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.3s;
    border-bottom: 1px solid #333;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #2a2a2a;
}

.search-result-icon {
    font-size: 24px;
}

.search-result-content {
    flex: 1;
}

.search-result-content strong {
    color: white;
    font-size: 14px;
}

.search-result-content small {
    color: #888;
    font-size: 12px;
    display: block;
}

.search-result-users {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #888;
    font-size: 13px;
}

/* Vues channels */
.channels-view {
    display: none;
}

.channels-view.active {
    display: block;
}

/* Channel cards */
.channel-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    background: #252525;
    border-radius: 12px;
    border-left: 4px solid #00bcd4;
    cursor: pointer;
    transition: all 0.3s;
}

.channel-card:hover {
    background: #2a2a2a;
    transform: translateX(5px);
}

.channel-card-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.channel-card-content {
    flex: 1;
}

.channel-card-content h3 {
    margin: 0 0 5px 0;
    color: white;
    font-size: 16px;
}

.channel-card-stats {
    display: flex;
    gap: 15px;
    color: #888;
    font-size: 13px;
}

.channel-users {
    display: flex;
    align-items: center;
    gap: 5px;
}

.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6b7280;
}

.online-dot.active {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.channel-arrow {
    font-size: 24px;
    color: #888;
}

/* ============================================
   CHAT WIDGET - Styles
   ============================================ */

.chat-widget {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 380px;
    max-height: 600px;
    background: #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 900;
    display: flex;
    flex-direction: column;
    transform: translateY(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-widget.active {
    transform: translateY(0);
    opacity: 1;
}

/* Header */
.chat-widget-header {
    padding: 15px;
    background: linear-gradient(135deg, #00bcd4, #0097a7);
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.chat-widget-header-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
}

.chat-widget-header button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.chat-widget-header button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages */
.chat-widget-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    max-height: 400px;
}

.chat-message {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.chat-message.mine {
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-message-content {
    flex: 1;
    max-width: 70%;
}

.chat-message.mine .chat-message-content {
    text-align: right;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.chat-message-header strong {
    color: #00bcd4;
    font-size: 13px;
}

.chat-message-time {
    color: #888;
    font-size: 11px;
}

.chat-message-text {
    background: #252525;
    padding: 10px 12px;
    border-radius: 12px;
    color: #ddd;
    font-size: 14px;
    line-height: 1.5;
}

.chat-message.mine .chat-message-text {
    background: #00bcd4;
    color: white;
}

/* Message VaIAna spÃ©cial */
.vaiana-welcome {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.1), rgba(245, 87, 108, 0.1));
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.vaiana-welcome .chat-message-text {
    background: transparent;
    color: #ddd;
    font-style: italic;
}

/* Input */
.chat-widget-input {
    padding: 15px;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-widget-input textarea {
    flex: 1;
    background: #252525;
    border: 2px solid #333;
    border-radius: 10px;
    padding: 10px;
    color: white;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    font-family: inherit;
}

.chat-widget-input textarea:focus {
    outline: none;
    border-color: #00bcd4;
}

.chat-widget-input button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: #00bcd4;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.chat-widget-input button:hover:not(:disabled) {
    background: #0097a7;
    transform: scale(1.05);
}

.chat-widget-input button:disabled {
    background: #6b7280;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .notification-panel {
        max-width: 100%;
    }
    
    .chat-widget {
        width: calc(100% - 40px);
        bottom: 70px;
        right: 20px;
        left: 20px;
    }
}

/* === FIX ALIGNEMENT NOTIFICATION BELL === */
/* Weather widget : layout flex pour alignement correct */
.weather-widget {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
}

/* Weather info reste Ã  gauche */
.weather-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Weather time : groupe central */
.weather-time {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1; /* Prend l'espace disponible */
    justify-content: flex-start;
}

/* Notification bell : container fixe 60px */
.notification-bell-container {
    position: relative;
    width: 60px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.3s;
    flex-shrink: 0;
    margin: 0;
}

.notification-bell-container:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Bell icon SVG */
.notification-bell {
    width: 24px;
    height: 24px;
    color: white;
    stroke: currentColor;
}

/* Theme switcher : reste Ã  droite */
.themeswitch {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .weather-widget {
        gap: 8px;
        padding: 8px 12px;
    }
    
    /* Weather info reste toujours Ã  gauche */
    .weather-info {
        order: -1; /* Force en premier */
        flex-shrink: 0;
    }
    
    /* Weather time peut wrapper */
    .weather-time {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    /* Bell plus compacte sur mobile */
    .notification-bell-container {
        width: 48px;
        height: 40px;
    }
    
    .notification-bell {
        width: 20px;
        height: 20px;
    }
    
    /* Theme switcher compact */
    .themeswitch {
        margin-left: 8px;
    }
}
