/* Common CSS - Styles partagés pour toutes les pages */

/* Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark Mode Variables (par défaut) */
    --bg-primary: #0a0e27;
    --bg-secondary: #1a1f3a;
    --bg-card: #252b4a;
    --accent-primary: #00d4ff;
    --accent-secondary: #7c3aed;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow: 0 8px 32px rgba(0, 212, 255, 0.1);
    --shadow-hover: 0 12px 48px rgba(0, 212, 255, 0.2);
}

/* Light Mode Variables */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --accent-primary: #0ea5e9;
    --accent-secondary: #8b5cf6;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #059669;
    --warning-color: #d97706;
    --error-color: #dc2626;
    --shadow: 0 8px 32px rgba(14, 165, 233, 0.1);
    --shadow-hover: 0 12px 48px rgba(14, 165, 233, 0.2);
}

/* Base Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: bgMove 20s ease-in-out infinite;
    transition: opacity 0.3s ease;
}

/* Light mode background */
[data-theme="light"] body::before {
    background: 
        radial-gradient(circle at 20% 80%, rgba(14, 165, 233, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
}

@keyframes bgMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(1deg); }
    66% { transform: translate(-20px, 20px) rotate(-1deg); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(20px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

[data-theme="light"] header {
    background: rgba(248, 250, 252, 0.95);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

/* Logo avec icône de développeur */
.logo-dev {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
}

.logo-dev:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.logo-dev-icon {
    font-size: 1.1rem;
    color: var(--accent-primary);
    transition: all 0.3s ease;
}

.logo-dev:hover .logo-dev-icon {
    transform: rotate(10deg) scale(1.1);
    color: var(--accent-secondary);
}

.logo-dev-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.logo-dev:hover .logo-dev-text {
    color: var(--accent-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .logo-dev-text {
        font-size: 0.9rem;
    }
    
    .logo-dev-icon {
        font-size: 1rem;
    }
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Corrections CSS pour la navigation mobile */

/* Header du menu mobile - simplifié */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

/* Enlever le logo mobile */
.mobile-logo {
    display: none;
}

/* Bouton fermer repositionné */
.mobile-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: auto;
}

.mobile-close:hover {
    background: var(--accent-primary);
    color: white;
    border-color: transparent;
}

/* Liens du menu mobile - style simplifié */
.mobile-menu-links {
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto; /* Permet le scroll sur mobile */
    max-height: calc(100vh - 120px); /* Hauteur maximale pour permettre le scroll */
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 2rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0;
    position: relative;
    overflow: hidden;
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    transition: all 0.4s ease;
    z-index: -1;
}

.mobile-nav-link:hover::before,
.mobile-nav-link.active::before {
    left: 0;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: white;
}

/* Icônes des liens mobiles */
.mobile-nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    transition: transform 0.3s ease;
}

.mobile-nav-link:hover i {
    transform: scale(1.1);
}

/* Texte des liens */
.mobile-nav-link span {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Lien CTA mobile - simple */
.mobile-cta {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)) !important;
    color: white !important;
    margin: 0.5rem 2rem;
    border-radius: 12px !important;
}

.mobile-cta::before {
    display: none;
}

.mobile-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Menu mobile - amélioration du scroll */
.modern-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1001;
    transform: translateX(-100%);
    opacity: 0;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Empêche le scroll de la page de fond */
}

.modern-mobile.active {
    transform: translateX(0);
    opacity: 1;
}

/* Support pour le scroll tactile */
.mobile-menu-links {
    -webkit-overflow-scrolling: touch; /* Scroll fluide sur iOS */
    scrollbar-width: none; /* Masquer scrollbar Firefox */
    -ms-overflow-style: none; /* Masquer scrollbar IE */
}

.mobile-menu-links::-webkit-scrollbar {
    display: none; /* Masquer scrollbar Webkit */
}

/* Empêche le scroll du body quand le menu mobile est ouvert */
body.nav-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Corrections pour le thème sombre */
[data-theme="dark"] .modern-mobile {
    background: rgba(20, 20, 30, 0.98);
}

[data-theme="dark"] .mobile-menu-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Animation d'entrée pour les liens - plus simple */
.mobile-nav-link {
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInLeft 0.4s ease-out forwards;
}

.mobile-nav-link:nth-child(1) { animation-delay: 0.1s; }
.mobile-nav-link:nth-child(2) { animation-delay: 0.15s; }
.mobile-nav-link:nth-child(3) { animation-delay: 0.2s; }
.mobile-nav-link:nth-child(4) { animation-delay: 0.25s; }
.mobile-nav-link:nth-child(5) { animation-delay: 0.3s; }

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive - s'assurer que le menu fonctionne sur toutes les tailles */
@media (max-width: 480px) {
    .mobile-menu-links {
        padding: 0.5rem 0;
    }
    
    .mobile-nav-link {
        padding: 1rem 1.5rem;
    }
    
    .mobile-cta {
        margin: 0.5rem 1.5rem;
    }
    
    .mobile-menu-header {
        padding: 1rem 1.5rem;
    }
}

/* FIX BOUTON HAMBURGER - Responsive correct */

/* DESKTOP (PC) - Cacher complètement le bouton hamburger */
.mobile-menu-toggle {
    display: none !important;
}

/* MOBILE - Afficher correctement le bouton hamburger */
@media (max-width: 768px) {
    /* Cacher la navigation desktop */
    .nav-links {
        display: none !important;
    }
    
    /* AFFICHER le bouton hamburger correctement */
    .mobile-menu-toggle {
        display: flex !important;
        width: 45px;
        height: 45px;
        border: none;
        border-radius: 50%;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        cursor: pointer;
        transition: all 0.3s ease;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: hidden;
    }
    
    /* Effet hover du bouton hamburger */
    .mobile-menu-toggle::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
        transition: all 0.4s ease;
        border-radius: 50%;
        z-index: -1;
    }
    
    .mobile-menu-toggle:hover::before {
        left: 0;
    }
    
    .mobile-menu-toggle:hover {
        color: white;
        border-color: transparent;
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    
    /* HAMBURGER LINES - Les 3 barres */
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 20px;
        height: 16px;
        position: relative;
    }
    
    .hamburger-line {
        width: 100%;
        height: 2px;
        background: currentColor;
        border-radius: 2px;
        transition: all 0.3s ease;
        display: block;
    }
    
    /* Animation du hamburger quand actif */
    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* S'assurer que le conteneur nav-actions est correct */
    .nav-actions {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    /* Ajustements header mobile */
    .modern-header nav.container {
        padding: 1rem;
        height: 70px;
    }
}

/* TABLET - Taille intermédiaire */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Sur tablette, garder la navigation desktop */
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .nav-links {
        display: flex !important;
    }
}

/* Assurance que les règles sont bien appliquées */
@media screen and (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
        visibility: hidden !important;
    }
}

@media screen and (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex !important;
        visibility: visible !important;
    }
    
    .nav-links {
        display: none !important;
        visibility: hidden !important;
    }
}

/* Debug - pour vérifier que le bouton est bien structuré */
.mobile-menu-toggle .hamburger {
    pointer-events: none; /* Les clics passent au bouton parent */
}

.mobile-menu-toggle .hamburger-line {
    pointer-events: none;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.theme-toggle i {
    font-size: 1.2rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.theme-toggle:hover i {
    color: white;
}

.theme-toggle .fa-sun {
    display: none;
}

.theme-toggle .fa-moon {
    display: block;
}

[data-theme="light"] .theme-toggle .fa-sun {
    display: block;
}

[data-theme="light"] .theme-toggle .fa-moon {
    display: none;
}

/* Common Page Headers */
.page-header {
    padding: 120px 0 60px;
    text-align: center;
}

.page-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Common Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.btn-secondary:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

/* Common Cards */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 2rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-primary);
}

.card:hover::before {
    transform: scaleX(1);
}

/* Section Titles */
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    font-size: 1.5rem;
}

/* Tags */
.tag {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
}

.tech-tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    display: inline-block;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

footer p {
    color: var(--text-secondary);
}

/* Responsive Base */
@media (max-width: 768px) {
    .page-title {
        font-size: 2.5rem;
    }
    
    /* Masquer navigation desktop */
    .nav-links {
        display: none;
    }
    
    /* Afficher menu hamburger */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Afficher menu mobile */
    .mobile-menu {
        display: block;
    }
    
    .nav-container {
        gap: 1rem;
    }
    
    .theme-toggle {
        width: 44px;
        height: 44px;
    }
    
    .page-header {
        padding: 100px 0 40px;
    }
    
    /* Ajustements pour le header mobile */
    nav {
        padding: 1rem 1.5rem;
    }
    
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    header {
        display: none;
    }
    
    .page-header {
        padding-top: 2rem;
    }
    
    .theme-toggle {
        display: none;
    }
}