/* Variables CSS */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #151515;
    --bg-tertiary: #1f1f1f;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent-primary: #8b5cf6;
    --accent-secondary: #c084fc;
    --border-color: #333333;
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
    --gradient-primary: linear-gradient(135deg, #8b5cf6, #7c3aed);
    --gradient-accent: linear-gradient(45deg, #8b5cf6, #7c3aed, #c084fc);

    /* Variables responsive */
    --animation-duration: 0.3s;
    --transition-duration: 0.3s;
    --particle-count: 10;
    --player-gap: 1rem;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #000000;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --accent-primary: #7c3aed;
    --accent-secondary: #a855f7;
    --border-color: #dee2e6;
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.3);
    --gradient-primary: linear-gradient(135deg, #7c3aed, #6d28d9);
    --gradient-accent: linear-gradient(45deg, #7c3aed, #6d28d9, #a855f7);
}

/* Classes d'état pour l'appareil */
.device-mobile-small { --max-particles: 0; }
.device-mobile-large { --max-particles: 3; }
.device-tablet { --max-particles: 6; }
.device-desktop-small { --max-particles: 8; }
.device-desktop-large { --max-particles: 12; }

.touch-device .hover-effect:hover {
    transform: none;
}

.mobile-landscape .entrance-content {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Utilitaires */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.accent {
    color: var(--accent-primary);
}

.hidden {
    display: none !important;
}

/* Classe pour lecteur d'écran */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus amélioré pour la navigation clavier */
.keyboard-navigation *:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== ÉCRAN D'ENTRÉE ===== */
.entrance-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 1s ease;
}

.entrance-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.entrance-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(192, 132, 252, 0.1));
    backdrop-filter: blur(2px);
}

.entrance-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 600px;
    padding: 2rem;
}

/* Effet glitch supprimé - Dégradé animé */
.glitch-container {
    margin-bottom: 2rem;
}

.glitch {
    font-size: 4rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    display: inline-block;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #8b5cf6, #c084fc, #a855f7, #7c3aed, #8b5cf6);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 3s ease-in-out infinite;
}

.glitch.secondary {
    font-size: 2rem;
    background: linear-gradient(45deg, #8b5cf6, #c084fc, #a855f7, #7c3aed, #8b5cf6);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 3s ease-in-out infinite;
}

@keyframes gradientFlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 100% 50%;
    }
    50% {
        background-position: 100% 100%;
    }
    75% {
        background-position: 0% 100%;
    }
}

.entrance-subtitle {
    margin-bottom: 3rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.typing-text {
    border-right: 2px solid var(--accent-primary);
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { border-color: transparent; }
}

.enter-btn {
    background: transparent;
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 1rem 2rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    border-radius: 4px;
}

.enter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left 0.3s ease;
    z-index: -1;
}

.enter-btn:hover::before {
    left: 0;
}

.enter-btn:hover {
    color: var(--bg-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.enter-btn i {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.enter-btn:hover i {
    transform: translateX(5px);
}

.entrance-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* LECTEUR AUDIO ENTRANCE - HARMONISÉ AVEC LE LECTEUR PRINCIPAL */
.entrance-audio-player {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.2);
    pointer-events: auto;
    position: relative;
    z-index: 1000;
    transition: all 0.3s ease;
}

.entrance-audio-player:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.2);
}

[data-theme="light"] .entrance-audio-player {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Isolation complète du lecteur - empêche la propagation vers l'écran d'entrée */
.entrance-audio-player * {
    pointer-events: auto !important;
}

.entrance-audio-player,
.entrance-audio-player *,
.entrance-player-controls,
.entrance-player-controls *,
.entrance-progress-container,
.entrance-progress-bar,
.entrance-player-buttons,
.entrance-player-btn,
.entrance-play-pause-btn {
    position: relative;
    z-index: 1001 !important;
}

/* Règle d'isolation pour éviter les conflits d'événements */
.entrance-audio-player {
    isolation: isolate;
}

/* Assure que tous les clics sur le lecteur ne remontent pas */
.entrance-audio-player,
.entrance-audio-player *:not(.entrance-track-title):not(.entrance-time) {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.entrance-player-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
    pointer-events: auto !important;
    z-index: 1002 !important;
}

.entrance-player-info {
    flex: 1;
    min-width: 0;
    pointer-events: none;
    z-index: 1002 !important;
}

.entrance-track-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
    pointer-events: none !important;
    user-select: none;
}

.entrance-player-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: auto !important;
    z-index: 1002 !important;
}

.entrance-time {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    min-width: 35px;
    pointer-events: none !important;
    user-select: none;
}

.entrance-progress-container {
    flex: 1;
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    pointer-events: auto !important;
    z-index: 1003 !important;
}

.entrance-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    position: relative;
    overflow: visible;
    pointer-events: auto !important;
    z-index: 1003 !important;
}

[data-theme="light"] .entrance-progress-bar {
    background: rgba(0, 0, 0, 0.2);
}

.entrance-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
    pointer-events: none !important;
}

.entrance-progress-handle {
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
    pointer-events: auto !important;
    z-index: 1004 !important;
}

.entrance-progress-container:hover .entrance-progress-handle {
    opacity: 1;
}

.entrance-progress-container:hover .entrance-progress-bar {
    height: 6px;
}

.entrance-player-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: auto !important;
    z-index: 1002 !important;
}

.entrance-player-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    pointer-events: auto !important;
    z-index: 1003 !important;
}

.entrance-player-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.1);
}

.entrance-play-pause-btn {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 1rem;
    pointer-events: auto !important;
    z-index: 1003 !important;
}

.entrance-play-pause-btn:hover {
    background: var(--accent-primary);
    transform: scale(1.05);
}

.entrance-play-pause-btn.playing {
    background: var(--accent-primary);
}

.control-btn {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.control-btn:hover,
.control-btn.active {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

/* Particules */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(100px); opacity: 0; }
}

/* ===== SITE PRINCIPAL ===== */
.main-site {
    min-height: 100vh;
    background: var(--bg-primary);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.9);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-primary);
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

.theme-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: 0.3s;
}

/* Sections */
.section {
    min-height: 100vh;
    padding: 6rem 0 4rem;
    display: flex;
    align-items: center;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

/* Section Home */
.home-section {
    background: var(--bg-primary);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.hero-location {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.hero-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-link {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.hero-link:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

/* Terminal */
.terminal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    max-width: 500px;
}

.terminal-header {
    background: var(--bg-tertiary);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.terminal-buttons {
    display: flex;
    gap: 0.5rem;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.btn-close { background: #ff5f57; }
.btn-minimize { background: #ffbd2e; }
.btn-maximize { background: #28ca42; }

.terminal-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.terminal-body {
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
}

.terminal-line {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prompt {
    color: var(--accent-primary);
    font-weight: 600;
}

.command {
    color: var(--text-primary);
}

.cursor {
    color: var(--accent-primary);
    animation: blink 1s infinite;
}

.terminal-output {
    margin: 1rem 0;
    padding-left: 1rem;
}

.skill-item {
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

/* Section About */
.about-section {
    background: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.about-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.about-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-5px);
}

.card-icon {
    width: 50px;
    height: 50px;
    background: var(--accent-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.about-card h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.about-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.about-card strong {
    color: var(--accent-primary);
}

/* Section Projects */
.projects-section {
    background: var(--bg-primary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.project-card:hover::before {
    transform: translateX(0);
}

.project-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-5px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.project-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.project-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
}

.project-card[data-status="completed"] .status-dot {
    background: #28ca42;
}

.project-card[data-status="in-progress"] .status-dot {
    background: #ffbd2e;
    animation: pulse 2s infinite;
}

.project-card[data-status="needs-improvement"] .status-dot {
    background: #ff5f57;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-title {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}

.project-link {
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: var(--accent-primary);
}

/* Section Contact */
.contact-section {
    background: var(--bg-secondary);
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.contact-links {
    display: grid;
    gap: 1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-link:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.contact-link i {
    font-size: 1.2rem;
    color: var(--accent-primary);
}

/* Footer */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    color: var(--text-secondary);
}

.footer i {
    color: #c084fc;
}

/* ===== LECTEUR AUDIO MODERNE ===== */
.audio-player {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 400px;
    max-width: 500px;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

[data-theme="light"] .audio-player {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.audio-player:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.2);
}

.player-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

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

.track-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.time-current,
.time-total {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    min-width: 35px;
}

.progress-container {
    flex: 1;
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    position: relative;
    overflow: visible;
}

[data-theme="light"] .progress-bar {
    background: rgba(0, 0, 0, 0.2);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
}

.progress-handle {
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.progress-container:hover .progress-handle {
    opacity: 1;
}

.progress-container:hover .progress-bar {
    height: 6px;
}

.player-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.player-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.1);
}

.play-pause-btn {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 1rem;
}

.play-pause-btn:hover {
    background: var(--accent-primary);
    transform: scale(1.05);
}

.play-pause-btn.playing {
    background: var(--accent-primary);
}

/* ===== BOUTON D'AIDE CORRIGÉ ===== */
#help-btn {
    position: fixed;
    bottom: 130px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 9998;
    display: none;
    box-shadow: var(--shadow-glow);
    transition: all 0.3s ease;
}

#help-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
    background: var(--accent-secondary);
}

#help-btn:active {
    transform: scale(0.95);
}

#help-btn:focus {
    outline: 3px solid rgba(139, 92, 246, 0.6);
    outline-offset: 2px;
}

/* Animation d'apparition améliorée */
@keyframes helpButtonAppear {
    from {
        opacity: 0;
        transform: scale(0) rotate(180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

#help-btn.show {
    animation: helpButtonAppear 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Pulsation subtile pour attirer l'attention */
@keyframes helpPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(139, 92, 246, 0);
    }
}

#help-btn.pulse {
    animation: helpPulse 2s infinite;
}

/* ===== RESPONSIVE MOBILE CORRIGÉ ===== */
@media (max-width: 768px) {
    /* Navigation mobile */
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: left 0.3s ease;
        z-index: 999;
    }

    [data-theme="light"] .nav-links {
        background: rgba(255, 255, 255, 0.95);
    }

    .nav-links.active {
        left: 0;
    }

    .nav-link {
        font-size: 1.2rem;
        padding: 1rem 2rem;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .nav-toggle {
        display: flex;
    }

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

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

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

    /* LECTEUR AUDIO MOBILE - CORRIGÉ */
    .audio-player {
        position: fixed;
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
        min-width: unset;
        max-width: unset;
        transform: none;
        padding: 0.75rem;
        gap: 0.75rem;
    }

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

    .player-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .player-info {
        flex: 1;
        min-width: 0;
        margin-right: 0.5rem;
    }

    .track-title {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
        line-height: 1.2;
    }

    .player-controls {
        gap: 0.5rem;
    }

    .time-current,
    .time-total {
        font-size: 0.7rem;
        min-width: 30px;
    }

    .progress-container {
        flex: 1;
        height: 15px;
    }

    .progress-bar {
        height: 3px;
    }

    .player-buttons {
        gap: 0.25rem;
        flex-shrink: 0;
    }

    .player-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .play-pause-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    /* Entrance audio mobile */
    .entrance-audio-player {
        width: calc(100% - 20px);
        min-width: unset;
        max-width: unset;
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .entrance-player-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .entrance-track-title {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }

    .entrance-player-controls {
        gap: 0.5rem;
    }

    .entrance-time {
        font-size: 0.7rem;
        min-width: 30px;
    }

    .entrance-progress-container {
        height: 15px;
    }

    .entrance-progress-bar {
        height: 3px;
    }

    .entrance-player-buttons {
        gap: 0.25rem;
    }

    .entrance-player-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .entrance-play-pause-btn {
        width: 36px;
        height: 36px;
    }

    /* Bouton d'aide mobile - POSITION CORRIGÉE */
    #help-btn {
        bottom: 120px !important;
        right: 15px !important;
        width: 45px !important;
        height: 45px !important;
        font-size: 1rem !important;
    }

    /* Sections mobile */
    .section {
        padding: 4rem 0 2rem;
        min-height: auto;
    }

    .contact-section {
        padding-bottom: 140px;
    }

    .footer {
        margin-bottom: 100px;
    }

    /* Autres éléments */
    .glitch {
        font-size: 2.5rem;
    }

    .glitch.secondary {
        font-size: 1.5rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .about-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    /* LECTEUR AUDIO TRÈS PETIT ÉCRAN */
    .audio-player {
        bottom: 8px;
        left: 8px;
        right: 8px;
        width: calc(100% - 16px);
        padding: 0.6rem;
        gap: 0.5rem;
    }

    .player-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .track-title {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }

    .player-controls {
        gap: 0.4rem;
    }

    .time-current,
    .time-total {
        font-size: 0.65rem;
        min-width: 25px;
    }

    .progress-container {
        height: 12px;
    }

    .player-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    .play-pause-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    /* Entrance audio très petit écran */
    .entrance-audio-player {
        width: calc(100% - 16px);
        padding: 0.6rem;
        gap: 0.5rem;
    }

    .entrance-player-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .entrance-track-title {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }

    .entrance-player-controls {
        gap: 0.4rem;
    }

    .entrance-time {
        font-size: 0.65rem;
        min-width: 25px;
    }

    .entrance-player-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    .entrance-play-pause-btn {
        width: 32px;
        height: 32px;
    }

    /* Bouton d'aide très petit écran - POSITION ENCORE PLUS HAUTE */
    #help-btn {
        bottom: 110px !important;
        right: 12px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 0.9rem !important;
    }

    /* Autres */
    .entrance-content {
        padding: 1rem;
    }

    .glitch {
        font-size: 2rem;
    }

    .glitch.secondary {
        font-size: 1.2rem;
    }

    .section {
        padding: 3rem 0 1.5rem;
    }

    .about-card,
    .project-card {
        padding: 1.5rem;
    }

    .hero-links {
        flex-direction: column;
    }

    .contact-section {
        padding-bottom: 120px;
    }

    .footer {
        margin-bottom: 90px;
    }
}

/* Écrans très petits */
@media (max-width: 320px) {
    #help-btn {
        bottom: 100px !important;
        right: 8px !important;
        width: 35px !important;
        height: 35px !important;
        font-size: 0.8rem !important;
    }
}

/* Mode paysage mobile */
@media (max-width: 896px) and (orientation: landscape) {
    #help-btn {
        bottom: 95px !important;
        right: 10px !important;
    }

    .audio-player {
        bottom: 8px;
        left: 8px;
        right: 8px;
        padding: 0.5rem;
    }

    .section {
        padding: 2rem 0;
    }

    .contact-section {
        padding-bottom: 100px;
    }

    .footer {
        margin-bottom: 80px;
    }
}

/* Optimisations tactiles */
@media (hover: none) and (pointer: coarse) {
    .player-btn,
    .entrance-player-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero-link,
    .contact-link {
        min-height: 44px;
        padding: 0.8rem 1rem;
    }

    .project-card:hover,
    .about-card:hover,
    .contact-link:hover {
        transform: none;
    }

    .player-btn:active,
    .entrance-player-btn:active,
    .enter-btn:active {
        transform: scale(0.95);
        opacity: 0.7;
    }
}

/* Animation pour le lecteur */
@keyframes playerSlideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideUpMobile {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.audio-player.show {
    animation: playerSlideUp 0.5s ease forwards;
}

@media (max-width: 768px) {
    .audio-player.show {
        animation: slideUpMobile 0.5s ease forwards;
    }
}

/* Animations supplémentaires */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Fixes pour Safari iOS */
@supports (-webkit-touch-callout: none) {
    .audio-player {
        -webkit-backdrop-filter: blur(20px);
    }

    .entrance-audio-player {
        -webkit-backdrop-filter: blur(15px);
    }

    .nav-links {
        -webkit-backdrop-filter: blur(20px);
    }
}

/* Gestion du débordement mobile */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .audio-player {
        overflow: hidden;
        white-space: nowrap;
    }

    .track-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Notifications responsives */
@media (max-width: 768px) {
    .notification,
    .theme-notification {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
        max-width: calc(100% - 20px) !important;
        font-size: 0.8rem !important;
        padding: 0.8rem 1rem !important;
        text-align: center;
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    .notification,
    .theme-notification {
        font-size: 0.75rem !important;
        padding: 0.7rem 0.8rem !important;
        line-height: 1.3;
    }
}

/* États de chargement */
.audio-player.loading {
    opacity: 0.7;
    pointer-events: none;
}

.audio-player.error {
    border-color: #ff5f57;
    background: rgba(255, 95, 87, 0.1);
}

/* Amélioration du focus */
@media (max-width: 768px) {
    .keyboard-navigation .player-btn:focus,
    .keyboard-navigation .entrance-player-btn:focus {
        outline: 3px solid var(--accent-primary);
        outline-offset: 2px;
    }
}

/* Animations réduites pour l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .particle {
        display: none;
    }

    .glitch {
        animation: none;
        background: var(--accent-primary);
        -webkit-background-clip: initial;
        -webkit-text-fill-color: initial;
        background-clip: initial;
    }
}

/* Optimisation données réduites */
@media (prefers-reduced-data: reduce) {
    .particle {
        display: none;
    }

    .glitch {
        background: var(--accent-primary);
        -webkit-background-clip: initial;
        -webkit-text-fill-color: initial;
        background-clip: initial;
        animation: none;
    }
}

/* Optimisation rendu */
.glitch,
.particle,
.progress-fill,
.entrance-progress-fill {
    will-change: transform;
}

.project-card,
.about-card,
.contact-link,
.hero-link {
    will-change: transform;
}

/* Print styles */
@media print {
    .entrance-screen,
    .audio-player,
    .entrance-audio-player,
    .particle,
    .nav-toggle,
    .theme-btn,
    .control-btn,
    #help-btn {
        display: none !important;
    }

    .main-site {
        display: block !important;
    }

    .navbar {
        position: relative;
        background: white;
        box-shadow: none;
    }

    .section {
        page-break-inside: avoid;
        min-height: auto;
        padding: 1rem 0;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
        line-height: 1.4;
    }

    .hero-links a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* ===== CORRECTION MOBILE - LECTEURS AUDIO HARMONISÉS ===== */

/* LECTEUR AUDIO ENTRANCE - MOBILE HARMONISÉ */
@media (max-width: 768px) {
    .entrance-audio-player {
        width: calc(100% - 20px) !important; /* Force la même largeur que le lecteur principal */
        min-width: unset !important;
        max-width: unset !important;
        padding: 0.75rem !important; /* Même padding que le lecteur principal */
        gap: 0.75rem !important; /* Même gap que le lecteur principal */
        background: rgba(0, 0, 0, 0.9) !important; /* Même background */
        backdrop-filter: blur(20px) !important; /* Même blur */
        border-radius: 12px !important; /* Même radius */
        box-shadow: 0 8px 32px rgba(139, 92, 246, 0.2) !important; /* Même shadow */
    }

    .entrance-player-icon {
        width: 35px !important; /* Même taille que le lecteur principal */
        height: 35px !important;
        font-size: 1rem !important;
        background: var(--gradient-primary) !important;
        border-radius: 8px !important;
    }

    .entrance-player-info {
        flex: 1 !important;
        min-width: 0 !important;
        margin-right: 0.5rem !important; /* Même marge que le lecteur principal */
    }

    .entrance-track-title {
        font-size: 0.8rem !important; /* Même taille que le lecteur principal */
        margin-bottom: 0.4rem !important;
        line-height: 1.2 !important;
        color: var(--text-primary) !important;
        font-weight: 600 !important;
    }

    .entrance-player-controls {
        gap: 0.5rem !important; /* Même gap que le lecteur principal */
    }

    .entrance-time {
        font-size: 0.7rem !important; /* Même taille que le lecteur principal */
        min-width: 30px !important;
        color: var(--text-secondary) !important;
        font-family: 'JetBrains Mono', monospace !important;
    }

    .entrance-progress-container {
        flex: 1 !important;
        height: 15px !important; /* Même hauteur que le lecteur principal */
    }

    .entrance-progress-bar {
        height: 3px !important; /* Même hauteur que le lecteur principal */
        background: rgba(255, 255, 255, 0.2) !important;
        border-radius: 2px !important;
    }

    .entrance-progress-fill {
        background: var(--gradient-primary) !important;
        border-radius: 2px !important;
        transition: width 0.1s ease !important;
    }

    .entrance-player-buttons {
        gap: 0.25rem !important; /* Même gap que le lecteur principal */
        flex-shrink: 0 !important;
    }

    .entrance-player-btn {
        width: 32px !important; /* Même taille que le lecteur principal */
        height: 32px !important;
        font-size: 0.8rem !important;
        background: transparent !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 6px !important;
        color: var(--text-secondary) !important;
    }

    .entrance-play-pause-btn {
        width: 36px !important; /* Même taille que le lecteur principal */
        height: 36px !important;
        font-size: 0.9rem !important;
        background: var(--gradient-primary) !important;
        border: none !important;
        color: white !important;
    }

    /* Thème clair pour entrance mobile */
    [data-theme="light"] .entrance-audio-player {
        background: rgba(255, 255, 255, 0.95) !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    }

    [data-theme="light"] .entrance-progress-bar {
        background: rgba(0, 0, 0, 0.2) !important;
    }
}

/* TRÈS PETIT ÉCRAN - HARMONISATION COMPLÈTE */
@media (max-width: 480px) {
    .entrance-audio-player {
        width: calc(100% - 16px) !important; /* Même largeur que le lecteur principal */
        padding: 0.6rem !important; /* Même padding que le lecteur principal */
        gap: 0.5rem !important; /* Même gap que le lecteur principal */
    }

    .entrance-player-icon {
        width: 30px !important; /* Même taille que le lecteur principal */
        height: 30px !important;
        font-size: 0.9rem !important;
    }

    .entrance-track-title {
        font-size: 0.75rem !important; /* Même taille que le lecteur principal */
        margin-bottom: 0.3rem !important;
    }

    .entrance-player-controls {
        gap: 0.4rem !important; /* Même gap que le lecteur principal */
    }

    .entrance-time {
        font-size: 0.65rem !important; /* Même taille que le lecteur principal */
        min-width: 25px !important;
    }

    .entrance-progress-container {
        height: 12px !important; /* Même hauteur que le lecteur principal */
    }

    .entrance-player-btn {
        width: 28px !important; /* Même taille que le lecteur principal */
        height: 28px !important;
        font-size: 0.7rem !important;
    }

    .entrance-play-pause-btn {
        width: 32px !important; /* Même taille que le lecteur principal */
        height: 32px !important;
        font-size: 0.8rem !important;
    }
}

/* CORRECTION POUR CENTRAGE MOBILE */
@media (max-width: 768px) {
    .entrance-controls {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 1.5rem !important;
        width: 100% !important;
    }

    .entrance-audio-player {
        margin: 0 auto !important; /* Centrage automatique */
        left: 50% !important;
        transform: translateX(-50%) !important;
        position: relative !important;
    }
}

/* AJUSTEMENT POUR LE BOUTON THÈME */
@media (max-width: 768px) {
    .control-btn {
        background: rgba(0, 0, 0, 0.9) !important; /* Même background que les lecteurs */
        backdrop-filter: blur(20px) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 8px !important;
        padding: 0.75rem 1rem !important;
        color: var(--text-secondary) !important;
        font-size: 0.9rem !important;
        transition: all 0.3s ease !important;
    }

    [data-theme="light"] .control-btn {
        background: rgba(255, 255, 255, 0.95) !important;
    }
}

/* VALIDATION VISUELLE - BORDURES TEMPORAIRES POUR DEBUG */
/*
@media (max-width: 768px) {
    .entrance-audio-player {
        border: 3px solid red !important;
    }

    .audio-player {
        border: 3px solid blue !important;
    }
}
*/