/* CSS pour les composants communs */

/* === HEADER DASHBOARD === */
.dashboard-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.dashboard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--brand-black);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Sora', sans-serif;
    transition: all 0.3s ease;
    letter-spacing: -0.025em;
}

.dashboard-logo:hover {
    color: var(--brand-gray-700);
    transform: translateY(-1px);
}

.dashboard-logo i {
    color: var(--brand-black);
    font-size: 2rem;
}

/* Navigation principale */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-nav {
    display: flex;
    gap: 0.5rem;
    background: var(--brand-gray-100);
    padding: 0.5rem;
    border-radius: 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-family: 'Sora', sans-serif;
}

.nav-link:hover {
    background: white;
    color: var(--primary-black);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-300);
}

.nav-link.active {
    background: var(--primary-black);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--primary-black);
}

.nav-link i {
    font-size: 0.85rem;
}

/* Lien principal pour créer un itinéraire */
.nav-link-primary {
    background: var(--primary-black) !important;
    color: white !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    position: relative;
    overflow: hidden;
    order: -1; /* S'assurer qu'il reste en premier même sur mobile */
    border: 1px solid var(--primary-black) !important;
}

.nav-link-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-link-primary:hover {
    background: var(--gray-800) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid var(--gray-800) !important;
}

.nav-link-primary:hover::before {
    left: 100%;
}

.nav-link-primary i {
    font-size: 0.9rem;
}

/* Menu utilisateur */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Balance de tokens */
.token-balance {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--gray-50);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--gray-300);
}

.token-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.token-icon {
    color: var(--primary-black);
    font-size: 1.1rem;
}

.token-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-black);
    font-family: 'Sora', sans-serif;
}

.token-label {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 500;
}

.btn-token-recharge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-black);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-token-recharge:hover {
    background: var(--gray-800);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Dropdown utilisateur */
.user-dropdown {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.user-trigger:hover {
    background: var(--gray-100);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--brand-black);
    object-fit: cover;
}

.user-details {
    text-align: left;
}

.user-details h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-black);
    font-family: 'Sora', sans-serif;
}

.user-details p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dropdown-arrow {
    color: var(--gray-600);
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.user-trigger.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Menu dropdown */
.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-width: 200px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 0.5rem;
    overflow: hidden;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: var(--brand-gray-100);
    color: var(--brand-black);
}

.dropdown-item i {
    color: var(--text-secondary);
    width: 16px;
    text-align: center;
}

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

.logout-btn {
    color: #dc3545;
}

.logout-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.logout-btn i {
    color: #dc3545;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 0.75rem 0;
    }

    .dashboard-nav {
        flex-direction: column;
        gap: 0.75rem;
    }

    .dashboard-logo {
        font-size: 1.5rem;
        text-align: center;
    }

    .header-center {
        order: 3;
        width: 100%;
    }

    .main-nav {
        width: 100%;
        justify-content: center;
        padding: 0.25rem;
        gap: 0.25rem;
    }

    .nav-link {
        flex: 1;
        justify-content: center;
        padding: 0.6rem 0.25rem;
        font-size: 0.75rem;
        border-radius: 6px;
    }

    .nav-link i {
        font-size: 0.8rem;
    }

    .nav-link-primary i {
        font-size: 0.85rem;
    }

    .user-menu {
        order: 2;
        justify-content: space-between;
        width: 100%;
    }

    .token-balance {
        flex: 1;
        justify-content: center;
    }

    .user-details {
        display: none;
    }
}

@media (max-width: 480px) {
    .dashboard-header {
        padding: 0.5rem 0;
    }
    
    .dashboard-nav {
        gap: 0.5rem;
    }
    
    .dashboard-logo {
        font-size: 1.3rem;
    }
    
    .token-label {
        display: none;
    }
    
    .nav-text {
        display: none;
    }
    
    .nav-link {
        padding: 0.6rem 0.5rem;
        min-width: 44px; /* Touch target minimum */
    }
    
    .nav-link i {
        font-size: 1rem;
    }
    
    .nav-link-primary i {
        font-size: 1.1rem;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
    }
    
    .user-details h4 {
        font-size: 0.85rem;
    }
}

/* Très petits écrans (mobile portrait) */
@media (max-width: 320px) {
    .main-nav {
        padding: 0.2rem;
        gap: 0.15rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.25rem;
        font-size: 0.7rem;
        min-width: 40px;
    }
    
    .dashboard-logo {
        font-size: 1.1rem;
    }
    
    .token-info {
        gap: 0.25rem;
    }
    
    .token-count {
        font-size: 0.85rem;
    }
}

/* ===== FOOTER COMPONENT ===== */
.app-footer {
    background: var(--gray-900);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Sora', sans-serif;
    letter-spacing: -0.025em;
}

.footer-logo i {
    color: white;
    font-size: 1.8rem;
}

.footer-tagline {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 0;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.footer-section h4 {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--brand-gray-300);
}

.footer-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-gray-300);
    margin-bottom: 0.25rem;
    font-family: 'Sora', sans-serif;
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright p {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--brand-gray-700);
    color: white;
    transform: translateY(-2px);
}

/* Footer responsive design */
@media (max-width: 1024px) {
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .footer-links {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .app-footer {
        padding: 2rem 0 1rem;
    }
}