/* ========================================
   PROJET PAGES - SHARED STYLES
   Cohérent avec index.css
======================================== */

/* ========================================
   VARIABLES & RESET
======================================== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(20, 20, 30, 0.6);
    --bg-card-hover: rgba(30, 30, 45, 0.7);

    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-dark: #7c3aed;
    --accent-glow: rgba(139, 92, 246, 0.4);

    --cyan: #06b6d4;
    --cyan-glow: rgba(6, 182, 212, 0.3);

    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(139, 92, 246, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);

    --transition: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 150ms var(--transition);
    --transition-normal: 300ms var(--transition);
    --transition-slow: 500ms var(--transition);

    --container-width: 1000px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background gradient */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.12), transparent),
        radial-gradient(ellipse 50% 50% at 90% 80%, rgba(6, 182, 212, 0.08), transparent),
        radial-gradient(ellipse 40% 40% at 10% 60%, rgba(139, 92, 246, 0.06), transparent);
    pointer-events: none;
    z-index: -1;
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent), var(--cyan));
    border-radius: 4px;
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--accent);
}

/* ========================================
   LAYOUT
======================================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   HEADER / NAV
======================================== */
.header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    transition: var(--transition-normal);
}

.header.scrolled {
    top: 12px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(20, 20, 30, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 100px;
    box-shadow: var(--shadow-md);
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.nav-toggle:hover {
    background: rgba(139, 92, 246, 0.1);
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 100px;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
}

.nav-link.active {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.15);
}

.nav-link.back {
    color: var(--accent-light);
    font-weight: 600;
}

.nav-link.back i {
    margin-right: 6px;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 8px;
}

/* ========================================
   HERO PROJECT
======================================== */
.hero-project {
    padding: 160px 0 80px;
}

.hero-project-content {
    text-align: center;
}

.project-badge-large {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cyan);
    background: rgba(6, 182, 212, 0.1);
    padding: 8px 16px;
    border-radius: 100px;
    margin-bottom: 20px;
}

.project-badge-large i {
    font-size: 16px;
}

.hero-project h1 {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-project-date {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.hero-project-date strong {
    color: var(--accent-light);
}

.hero-project-intro {
    max-width: 700px;
    margin: 0 auto;
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.hero-project-intro strong {
    color: var(--text-primary);
}

/* ========================================
   SECTION TITLES
======================================== */
.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    border-radius: var(--radius-md);
    font-size: 22px;
    color: white;
    flex-shrink: 0;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ========================================
   CONTENT SECTIONS
======================================== */
.content-section {
    padding: 60px 0;
}

.content-section:first-of-type {
    padding-top: 0;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 0;
}

/* ========================================
   CARDS
======================================== */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--transition-fast);
}

.info-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.info-card:last-child {
    margin-bottom: 0;
}

.info-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-light);
    margin-bottom: 16px;
}

.info-card-title i {
    font-size: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.info-grid .info-card {
    margin-bottom: 0;
}

/* ========================================
   LISTS
======================================== */
.styled-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.styled-list li {
    list-style: none;
    position: relative;
    padding: 10px 0 10px 24px;
    font-size: 15px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.styled-list li:last-child {
    border-bottom: none;
}

.styled-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18px;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    border-radius: 50%;
}

.styled-list li strong,
.styled-list li b {
    color: var(--text-primary);
}

/* Nested list */
.styled-list li ul {
    margin-top: 10px;
    padding-left: 16px;
}

.styled-list li ul li {
    font-size: 14px;
    padding: 6px 0 6px 20px;
}

.styled-list li ul li::before {
    width: 6px;
    height: 6px;
    top: 13px;
    background: var(--cyan);
}

/* Ordered list */
.styled-list.ordered {
    counter-reset: list-counter;
}

.styled-list.ordered > li {
    padding-left: 32px;
}

.styled-list.ordered > li::before {
    content: counter(list-counter);
    counter-increment: list-counter;
    width: auto;
    height: auto;
    background: none;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-light);
    top: 10px;
    left: 0;
}

/* ========================================
   TEXT CONTENT
======================================== */
.text-content {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.text-content p {
    margin-bottom: 16px;
}

.text-content p:last-child {
    margin-bottom: 0;
}

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

/* ========================================
   BUTTONS
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn i {
    font-size: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.buttons-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
}

/* ========================================
   GALLERY - MODERN DESIGN
======================================== */
.gallery-section {
    margin-top: 32px;
}

.gallery-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
    overflow: hidden;
}

.gallery-card:last-child {
    margin-bottom: 0;
}

.gallery-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent-light);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-card-title i {
    font-size: 20px;
    padding: 8px;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    border-radius: var(--radius-sm);
    color: white;
}

.gallery {
    position: relative;
    user-select: none;
}

/* Modern scrollable gallery */
.gallery-images {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 16px 4px 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.gallery-images::-webkit-scrollbar {
    display: none;
}

/* Custom scrollbar track below */
.gallery::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.gallery-images figure {
    flex-shrink: 0;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    position: relative;
}

.gallery-images img {
    width: 260px;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.4s var(--transition);
    cursor: pointer;
    position: relative;
}

.gallery-images figure::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    border-radius: calc(var(--radius-lg) + 4px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s var(--transition);
}

.gallery-images figure:hover::before {
    opacity: 1;
}

.gallery-images img:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(139, 92, 246, 0.25);
}

.gallery-images figcaption {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    max-width: 260px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    transition: all 0.3s var(--transition);
}

.gallery-images figure:hover figcaption {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--border-hover);
}

/* Modern navigation arrows */
.scroll-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-70%);
    width: 44px;
    height: 44px;
    background: rgba(20, 20, 30, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s var(--transition);
    z-index: 10;
    opacity: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.gallery:hover .scroll-hint {
    opacity: 1;
}

.scroll-hint:hover {
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    border-color: transparent;
    transform: translateY(-70%) scale(1.1);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.scroll-hint span {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
}

.scroll-hint:hover span {
    color: white;
}

.scroll-hint-left {
    left: 8px;
}

.scroll-hint-right {
    right: 8px;
}

/* Gallery dots indicator */
.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding-bottom: 4px;
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.3s var(--transition);
}

.gallery-dot:hover {
    background: rgba(255, 255, 255, 0.3);
}

.gallery-dot.active {
    width: 24px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
}

/* ========================================
   GALLERY OVERLAY - LIGHTBOX
======================================== */
.gallery-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(20px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s var(--transition);
}

.gallery-overlay.active {
    display: flex;
    animation: fadeIn 0.3s var(--transition) forwards;
}

.gallery-overlay.closing {
    animation: fadeOut 0.3s var(--transition) forwards;
}

.gallery-overlay.closing .overlay-image {
    animation: zoomOut 0.3s var(--transition) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

.gallery-overlay .overlay-image {
    max-width: 85%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.4s var(--transition);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-overlay .overlay-figcaption {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    background: rgba(20, 20, 30, 0.9);
    backdrop-filter: blur(10px);
    padding: 14px 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 80%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Image counter */
.overlay-counter {
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    background: rgba(20, 20, 30, 0.8);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 100px;
}

.overlay-counter span {
    color: var(--accent-light);
    font-weight: 600;
}

.gallery-overlay .close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--transition);
}

.gallery-overlay .close-btn:hover {
    background: rgba(255, 80, 80, 0.2);
    border-color: rgba(255, 80, 80, 0.3);
    color: #ff6b6b;
    transform: rotate(90deg);
}

.gallery-overlay .prev-btn,
.gallery-overlay .next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(20, 20, 30, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--transition);
}

.gallery-overlay .prev-btn:hover,
.gallery-overlay .next-btn:hover {
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    border-color: transparent;
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.gallery-overlay .prev-btn {
    left: 32px;
}

.gallery-overlay .next-btn {
    right: 32px;
}

.gallery-overlay .prev-btn.disabled,
.gallery-overlay .next-btn.disabled {
    opacity: 0.2;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========================================
   FOOTER
======================================== */
.footer {
    padding: 40px 0;
    margin-top: 60px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

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

.footer p {
    font-size: 14px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.footer-links a i {
    font-size: 16px;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 900px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    /* Mobile nav */
    .header {
        left: 20px;
        right: 20px;
        transform: none;
        width: auto;
    }

    .nav {
        position: relative;
        flex-direction: column;
        align-items: center;
        border-radius: var(--radius-lg);
        padding: 8px;
        width: 100%;
    }

    .nav-toggle {
        display: flex;
        align-self: center;
    }

    .nav-divider {
        display: none;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        width: 100%;
        gap: 4px;
        margin-top: 8px;
        padding: 8px;
        background: rgba(20, 20, 30, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-links.active {
        max-height: 400px;
        opacity: 1;
        pointer-events: auto;
    }

    .nav-link {
        padding: 12px 16px;
        border-radius: var(--radius-md);
        text-align: center;
        width: 100%;
        transform: translateY(-10px);
        opacity: 0;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    background 0.15s ease,
                    color 0.15s ease;
    }

    .nav-links.active .nav-link {
        transform: translateY(0);
        opacity: 1;
    }

    .nav-links.active .nav-link:nth-child(1) { transition-delay: 0.05s; }
    .nav-links.active .nav-link:nth-child(2) { transition-delay: 0.1s; }
    .nav-links.active .nav-link:nth-child(3) { transition-delay: 0.15s; }
    .nav-links.active .nav-link:nth-child(4) { transition-delay: 0.2s; }
    .nav-links.active .nav-link:nth-child(5) { transition-delay: 0.25s; }
    .nav-links.active .nav-link:nth-child(6) { transition-delay: 0.3s; }

    .hero-project {
        padding: 140px 0 60px;
    }

    .hero-project h1 {
        font-size: 28px;
    }

    .section-header h2 {
        font-size: 20px;
    }

    .gallery-images img {
        width: 200px;
        height: 140px;
    }

    .gallery-images figcaption {
        max-width: 200px;
        font-size: 12px;
    }

    .scroll-hint {
        width: 36px;
        height: 36px;
        opacity: 0.8;
    }

    .gallery:hover .scroll-hint {
        opacity: 1;
    }

    .scroll-hint-left {
        left: 4px;
    }

    .scroll-hint-right {
        right: 4px;
    }

    .gallery-dots {
        gap: 6px;
    }

    .gallery-dot {
        width: 6px;
        height: 6px;
    }

    .gallery-dot.active {
        width: 18px;
    }
}

@media (max-width: 500px) {
    .buttons-row {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .footer-links {
        flex-direction: column;
        gap: 12px;
    }

    .gallery-overlay .prev-btn,
    .gallery-overlay .next-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .gallery-overlay .prev-btn {
        left: 10px;
    }

    .gallery-overlay .next-btn {
        right: 10px;
    }
}
