/**
 * COMPONENTS STYLES
 * Styles pour tous les composants réutilisables
 */

/* ==================== NAVBAR ==================== */
/* ==================== NAVBAR ==================== */
.navbar {
    background: var(--glass-panel-bg);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: var(--glass-shadow);
}

/* Neumorphic Connexion Button Override */
.navbar .btn-primary {
    background: linear-gradient(145deg, #161616, #121212);
    box-shadow:
        4px 4px 8px rgba(0, 0, 0, 0.6),
        -4px -4px 8px rgba(255, 255, 255, 0.05);
    color: var(--color-purple-primary);
    border: 1px solid rgba(255, 255, 255, 0.02);
    font-weight: 600;
    transition: all 0.2s ease;
}

.navbar .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        6px 6px 12px rgba(0, 0, 0, 0.7),
        -6px -6px 12px rgba(255, 255, 255, 0.08);
    /* Stronger pop */
    color: var(--color-pink-primary);
    /* Gradient shift feeling */
}

.navbar .btn-primary:active {
    transform: translateY(0);
    box-shadow:
        inset 3px 3px 6px rgba(0, 0, 0, 0.5),
        inset -3px -3px 6px rgba(255, 255, 255, 0.05);
    /* Pressed */
}









.nav-link {
    padding: var(--space-xs) 0;
    color: var(--color-text-secondary);
    font-weight: 700;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-size: 0.95rem;
}

.nav-link:hover {
    color: var(--color-text-primary);
}

.nav-link.active {
    background: transparent;
    color: var(--color-text-primary);
    font-weight: 900;
}

/* ==================== MICRO-MOBILE (<= 360px) ==================== */
@media (max-width: 360px) {
    .navbar-brand-text {
        font-size: 1.1rem !important;
    }
    .navbar-icon-btn {
        width: 34px !important;
        height: 34px !important;
        font-size: 1rem !important;
    }
    .user-avatar {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.85rem !important;
    }
    .navbar-toggle {
        margin-left: 2px !important;
        padding: 4px !important;
    }
}



.navbar-search-wrapper {
    position: relative;
    z-index: 1001;
}

.navbar-search {
    position: relative;
    margin-right: var(--space-sm);
}

.search-results-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    padding: 0.5rem;
    animation: slideInDown 0.2s ease-out;
}

.search-result-item {
    padding: 0.6rem;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.search-result-item:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateX(4px);
}

.search-result-thumb {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}



.search-result-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.search-result-empty {
    padding: 1rem;
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
}

.search-result-view-all {
    display: block;
    margin-top: 0.5rem;
    padding: 0.6rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-purple-primary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    transition: color 0.2s;
}

.search-result-view-all:hover {
    color: var(--color-pink-primary);
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.navbar-search-input {
    width: 250px;
    padding-left: 40px;
    background: var(--color-input-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    color: var(--color-text-primary);
}

.navbar-search-input::placeholder {
    color: var(--color-input-placeholder);
}

.navbar-search-input:focus {
    border-color: var(--color-purple-primary);
}

.navbar-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
}

.navbar-search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
    color: var(--color-text-muted);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.navbar-search-btn:hover {
    transform: translateY(-50%) scale(1.1);
    filter: brightness(1.2);
}



.navbar-icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    transition: color 0.2s;
}

.navbar-icon-btn:hover {
    color: var(--color-text-primary);
    background: transparent;
}

/* User Avatar */
.navbar-profile {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-left: var(--space-xs);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-purple-pink);
    color: #fff;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.4);
    /* Pink glow */
}

/* ==================== PROFILE DROPDOWN ==================== */
.navbar-profile-container {
    position: relative;
    margin-left: var(--space-xs);
}

.profile-dropdown {
    position: absolute;
    top: 120%;
    right: 0;
    width: 220px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-sm) 0;
    box-shadow: var(--shadow-xl);

    /* Animation state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: var(--z-dropdown);
}

.profile-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==================== NOTIFICATION DROPDOWN ==================== */
.notification-menu {
    position: absolute;
    top: 120%;
    right: -100px;
    /* Center relative to bell */
    width: 320px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0;
    /* Padding handled by children */
    box-shadow: var(--shadow-xl);

    /* Animation state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: var(--z-dropdown);
    overflow: hidden;
    /* For border radius */
}

.notification-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .notification-menu {
        right: -20px;
        width: 300px;
    }
}
@media (max-width: 480px) {
    .notification-menu {
        right: -45px;
        width: 300px;
    }
}
@media (max-width: 360px) {
    .notification-menu {
        right: -65px;
        width: 290px;
    }
}

.notification-header {
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
}

.notification-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: var(--space-md);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: var(--color-bg-elevated);
}

.notification-item.unread {
    background: rgba(139, 92, 246, 0.05);
}

.notification-actor-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: var(--space-md);
}

.notification-placeholder-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-purple-primary);
    color: white;
    margin-right: var(--space-md);
}

.notification-content {
    flex: 1;
}

.notification-verb {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
}

.notification-time {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.notification-footer {
    padding: var(--space-sm);
    text-align: center;
    border-top: 1px solid var(--color-border);
}

.notification-footer-link {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-purple-primary);
}

.dropdown-header {
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-xs);
}

.dropdown-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    /* Bold as per image */
    color: var(--color-text-primary);
}

.dropdown-item {
    padding: 10px 16px;
    color: var(--color-text-secondary);
    /* Greyish default */
    text-decoration: none;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--color-bg-elevated);
    color: var(--color-text-primary);
}

.dropdown-icon {
    width: 20px;
    /* Fixed width for alignment */
    text-align: center;
    font-size: 1.1em;
}

.dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-xs) 0;
}

.text-danger {
    color: #ef4444 !important;
    /* Red for logout */
}

.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.dropdown-form {
    margin: 0;
}

/* ==================== EMPTY STATE ==================== */
/* Styles already in tokens.css */

/* ==================== SECTION HEADER ==================== */
/* Styles already in tokens.css */

/* ==================== CTA BANNER ==================== */
.cta-banner {
    background: var(--gradient-purple-pink);
    border-radius: var(--radius-xl);
    padding: var(--space-3xl) var(--space-2xl);
    text-align: center;
    margin: var(--space-3xl) 0;
    box-shadow: var(--shadow-xl);
}

.cta-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-lg);
}

.cta-title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-md);
    color: #ffffff;
}

.cta-description {
    font-size: var(--font-size-lg);
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto var(--space-xl);
    line-height: 1.6;
}

.cta-btn-primary {
    padding: 14px 32px;
    background: white;
    color: var(--color-purple-primary);
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
}

.cta-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3);
}

.cta-btn-secondary {
    padding: 14px 32px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    transition: all var(--transition-base);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.cta-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .cta-title {
        font-size: var(--font-size-2xl) !important;
    }

    .cta-description {
        font-size: var(--font-size-base) !important;
    }
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-3xl);
    padding: var(--space-2xl) 0;
}



.footer-brand-text {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-xs);
}

.footer-copyright {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}



.footer-link {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    transition: color var(--transition-fast);
    text-decoration: none;
}

.footer-link:hover {
    color: var(--color-text-primary);
}

.footer-quote-container {
    text-align: center;
    max-width: 600px;
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(145deg, rgba(20, 20, 25, 0.6), rgba(10, 10, 15, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    margin: 0 var(--space-md);
}

.footer-quote-container::before {
    content: '"';
    position: absolute;
    top: -15px;
    left: 15px;
    font-size: 5rem;
    font-family: serif;
    color: var(--color-purple-primary);
    opacity: 0.15;
    line-height: 1;
}

.footer-quote-text {
    font-style: italic;
    color: var(--color-text-primary);
    font-size: 1.05rem;
    margin-bottom: var(--space-xs);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.footer-quote-author {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--color-pink-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    padding-top: var(--space-xs);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

/* ==================== GLASS PANEL (Global) ==================== */
.glass-panel {
    background: var(--glass-panel-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
}

/* ==================== UTILITY CLASSES ==================== */
.hidden {
    display: none !important;
}

.placeholder {
    background-color: #333 !important;
}

.placeholder-trending {
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 300px;
    max-width: 450px;
    background: rgba(25, 25, 30, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    color: var(--color-text-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: toast-slide-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-error .toast-icon,
.toast-danger .toast-icon {
    color: #ef4444;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info .toast-icon {
    color: var(--color-purple-primary);
}

.toast-content {
    flex-grow: 1;
    font-size: 0.95rem;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--color-text-primary);
}

.toast-exit {
    animation: toast-fade-out 0.3s ease forwards;
}

@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-fade-out {
    to {
        transform: scale(0.95);
        opacity: 0;
    }
}

@media (max-width: 600px) {
    .toast-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .toast {
        min-width: 0;
    }
}

/* --- POST-MIGRATION FIXES --- */
.notification-list li.empty-notif-item i {
    font-size: 2.5rem !important;
    color: var(--color-text-dim);
    margin-bottom: var(--space-sm);
    display: block;
}

.notification-list li.empty-notif-item {
    padding: var(--space-2xl) var(--space-md) !important;
}

/* --- NOTIFICATION BADGE COUNTER --- */
.navbar-notification-container {
    position: relative;
}

.notif-count-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border-radius: 999px;
    pointer-events: none;
}

/* --- MOBILE NAVIGATION OVERRIDES --- */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-primary);
    cursor: pointer;
    padding: var(--space-xs);
    transition: transform 0.2s ease, color 0.2s ease;
    margin-left: var(--space-sm);
}

.navbar-toggle:hover {
    color: var(--color-purple-primary);
}

.navbar-toggle:active {
    transform: scale(0.9);
}

@media (max-width: 768px) {
    .navbar-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .navbar-menu {
        position: fixed;
        top: 0;
        right: 0;
        transform: translateX(100%);
        width: 85%;
        max-width: 320px;
        height: 100vh;
        visibility: hidden;

        /* Glassmorphism */
        background: rgba(20, 20, 25, 0.8);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);

        flex-direction: column;
        padding: 120px var(--space-xl) var(--space-lg);
        gap: var(--space-xl);
        transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1), visibility 0.35s;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
        border-left: 1px solid rgba(255, 255, 255, 0.05);
        z-index: 9999;
    }

    .navbar-menu::before {
        /* Optional: Noise texture overlay for premium feel could go here */
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    }

    .navbar-menu.active {
        transform: translateX(0);
        visibility: visible;
    }

    .nav-link {
        font-size: 1.2rem;
        padding: var(--space-md) 0;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        text-align: left;
        color: rgba(255, 255, 255, 0.8);
    }

    .nav-link.active {
        color: var(--color-purple-primary);
        border-bottom-color: var(--color-purple-primary);
    }

    .navbar-search {
        display: none !important;
    }

    .navbar-brand {
        margin-right: 0 !important;
    }
}