/**
 * Styles communs - Ado Plus v2.0
 * Header, Footer et éléments partagés
 */

/* ========================================
   VARIABLES CSS
   ======================================== */
:root {
    /* Couleurs principales */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    /* Couleurs de texte */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-white: #ffffff;
    
    /* Couleurs de fond */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    
    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Espacements */
    --header-height: 70px;
    --container-max-width: 1200px;
    
    /* Animations */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-muted: #9ca3af;
        
        --bg-primary: #111827;
        --bg-secondary: #1f2937;
        --bg-tertiary: #374151;
        --border-color: #374151;
        
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    }
}

/* ========================================
   RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-normal), color var(--transition-normal);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.menu-open {
    overflow: hidden;
}

/* ========================================
   CONTAINER
   ======================================== */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* ========================================
   HEADER
   ======================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    gap: 2rem;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    transition: transform var(--transition-fast);
}

.logo:hover {
    transform: translateY(-2px);
}

.logo-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.logo-text {
    font-size: 1.25rem;
}

/* Navigation desktop */
.nav-desktop {
    display: none; /* Masqué par défaut sur mobile */
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

@media (min-width: 768px) {
    .nav-desktop {
        display: flex; /* Affiché sur desktop */
    }
}

.nav-link {
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: var(--bg-secondary);
}

.nav-link.active {
    color: var(--primary-color);
    background-color: var(--bg-secondary);
}

/* Actions header */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Boutons */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background-color: var(--bg-secondary);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

/* Menu utilisateur */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    font-size: 0.9375rem;
}

.user-menu-trigger:hover {
    background-color: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.user-avatar,
.user-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-name {
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-arrow {
    transition: transform var(--transition-fast);
}

.user-menu-trigger:hover .user-menu-arrow {
    transform: translateY(2px);
}

/* Dropdown menu */
.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 250px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 1001;
}

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

.user-menu-header {
    padding: 1rem;
}

.user-menu-info strong {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.badge-admin {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-moderator {
    background-color: #dbeafe;
    color: #1e40af;
}

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

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color var(--transition-fast);
    font-size: 0.9375rem;
}

.user-menu-item:hover {
    background-color: var(--bg-secondary);
}

.user-menu-item:first-of-type {
    border-radius: 0.75rem 0.75rem 0 0;
}

.user-menu-item:last-of-type {
    border-radius: 0 0 0.75rem 0.75rem;
}

.user-menu-item .item-icon {
    font-size: 1.125rem;
    line-height: 1;
}

.item-danger {
    color: var(--danger-color);
}

.item-danger:hover {
    background-color: #fee2e2;
}

.notification-badge {
    margin-left: auto;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    min-width: 1.25rem;
    text-align: center;
}

/* Menu mobile toggle */
.mobile-menu-toggle {
    display: flex; /* Affiché par défaut sur mobile */
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
}

@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none; /* Masqué sur desktop */
    }
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Menu mobile */
.mobile-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-primary);
    transform: translateX(100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    z-index: 999;
    box-shadow: var(--shadow-xl);
}

.mobile-menu.active {
    transform: translateX(0) !important;
}

@media (min-width: 768px) {
    .mobile-menu {
        display: none; /* Complètement masqué sur desktop */
    }
}

.mobile-nav {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1rem;
    transition: background-color var(--transition-fast);
}

.mobile-nav-link:hover {
    background-color: var(--bg-secondary);
}

.mobile-nav-danger {
    color: var(--danger-color);
}

.mobile-nav-primary {
    background-color: var(--primary-color);
    color: white;
}

.mobile-nav-primary:hover {
    background-color: var(--primary-hover);
}

.mobile-menu-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.75rem 0;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    flex: 1;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* ========================================
   BOTTOM NAVIGATION BAR
   ======================================== */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 998;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    backdrop-filter: blur(10px);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    flex: 1;
    max-width: 100px;
}

.bottom-nav-item:hover {
    color: var(--primary-color);
    background: var(--bg-secondary);
    border-radius: 0.75rem;
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-item.active .bottom-nav-icon svg {
    stroke: var(--primary-color);
}

/* Icône téléphone verte quand un appel est actif */
.bottom-nav-item.call-active {
    color: #10b981;
}

.bottom-nav-item.call-active .bottom-nav-icon svg {
    stroke: #10b981;
    fill: #10b981;
}

.bottom-nav-item.call-active:hover {
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
}

.bottom-nav-item.call-active:hover .bottom-nav-icon svg {
    stroke: #059669;
    fill: #059669;
}

.bottom-nav-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav-icon svg {
    transition: all 0.2s ease;
}

.bottom-nav-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

.bottom-nav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 1rem;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    transition: all 0.3s ease;
}

/* Animation pour les badges */
.bottom-nav-badge.badge-pulse {
    animation: badgePulse 0.6s ease-in-out;
    transform: scale(1.2);
}

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

/* Indicateur d'amis en ligne */
.online-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    z-index: 10;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
    }
}

/* Animation d'entrée pour les nouveaux éléments */
.bottom-nav-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav-item:hover {
    transform: translateY(-2px);
}

.bottom-nav-item.active {
    transform: translateY(-1px);
}

/* Adaptation responsive */
@media (min-width: 1024px) {
    .bottom-nav-bar {
        display: none; /* Masquer sur desktop uniquement (>1024px) */
    }
}

@media (max-width: 1023px) {
    /* Ajouter un padding bottom au main-content pour éviter que le contenu soit caché par la bottom bar */
    .main-content {
        padding-bottom: 80px;
    }
    
    /* Masquer le footer classique sur mobile pour éviter la redondance */
    .site-footer {
        padding-bottom: 80px;
    }
}

/* Animation pour les badges */
@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.bottom-nav-badge:not(:empty) {
    animation: badgePulse 2s ease-in-out infinite;
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
    background-color: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

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

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

.footer-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.footer-icon {
    font-size: 1.5rem;
}

.footer-description {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.footer-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-item strong {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-item span {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-color);
}

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

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-copyright,
.footer-tagline {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-copyright {
    margin-bottom: 0.25rem;
}

.footer-copyright strong {
    color: var(--text-primary);
}

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

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

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

/* ========================================
   RESPONSIVE
   ======================================== */
@media (min-width: 768px) {
    .btn {
        display: inline-flex;
    }
}

@media (max-width: 767px) {
    :root {
        --header-height: 60px;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .logo-text {
        font-size: 1.125rem;
    }
    
    .user-name {
        display: none;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-outline {
        display: none;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* La première section (À propos) prend toute la largeur (compatible 1 colonne ou plus) */
    .footer-content > .footer-section:first-child {
        grid-column: 1 / -1;
    }
    
    .footer-section {
        gap: 0.5rem;
    }
    
    .footer-title {
        font-size: 1.125rem;
    }
    
    .footer-icon {
        font-size: 1.25rem;
    }
    
    .footer-description {
        font-size: 0.875rem;
        line-height: 1.6;
    }
    
    .footer-subtitle {
        font-size: 0.9375rem;
        margin-bottom: 0.375rem;
    }
    
    .footer-links {
        gap: 0.5rem;
    }
    
    .footer-links a {
        font-size: 0.875rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .btn-primary {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }
    
    /* Footer encore plus compact sur très petits écrans */
    .footer-content {
        gap: 1.25rem;
    }
    
    .footer-title {
        font-size: 1rem;
    }
    
    .footer-description {
        font-size: 0.8125rem;
    }
    
    .footer-subtitle {
        font-size: 0.875rem;
    }
    
    .footer-links a {
        font-size: 0.8125rem;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

.btn:focus,
.nav-link:focus,
.user-menu-trigger:focus,
.mobile-menu-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
    }
    
    .btn-outline,
    .user-menu-trigger {
        border-width: 2px;
    }
}

/* ========================================
   MASQUER LE MENU RACCOURCI SUR DESKTOP
   ======================================== */

/* Masquer le menu raccourci sur desktop (écrans larges) */
@media (min-width: 768px) {
    .bottom-nav-bar {
        display: none !important;
    }
    
    /* Ajuster le padding du contenu principal sur desktop */
    .main-content {
        padding-bottom: 0 !important;
    }
}

/* Masquer le menu raccourci en mode horizontal (landscape) */
@media (orientation: landscape) and (max-height: 500px) {
    .bottom-nav-bar {
        display: none !important;
    }
    
    /* Ajuster le padding du contenu principal en mode horizontal */
    .main-content {
        padding-bottom: 0 !important;
    }
}

