/* ===================================
   COMPONENTS
   =================================== */

/* ===== BUTTONS ===== */

/* ===== BUTTONS - WOBBLY LIQUID GLASS ===== */

@keyframes floatBubble {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(10px, -10px) rotate(5deg);
    }

    66% {
        transform: translate(-5px, 5px) rotate(-5deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: 16px 36px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-primary);
    text-decoration: none;
    border-radius: 100px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    letter-spacing: 0.02em;
    z-index: 10;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Structure de base transparente */
    background: rgba(255, 255, 255, 0.01);
    box-shadow:
        inset 0 0 20px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 8px 32px rgba(0, 0, 0, 0.1);

    /* Distorsion Liquide Appliquée */
    -webkit-backdrop-filter: blur(10px) url(#liquid-glass-distortion);
    backdrop-filter: blur(10px) url(#liquid-glass-distortion);

    color: var(--text-primary);
}

/* Pseudo-élément pour l'effet de "liquide qui bouge" interne */
.btn::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle at 50% 50%,
            rgba(255, 255, 255, 0.4),
            transparent 60%);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.4s, transform 0.4s;
    z-index: -1;
    filter: blur(20px);
}

.btn:hover::before {
    opacity: 1;
    transform: scale(1.2);
    animation: floatBubble 4s ease-in-out infinite;
}

.btn:hover {
    transform: translateY(-4px) scale(1.05);
    /* Effet "bulle" qui grossit */
    box-shadow:
        inset 0 0 30px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 15px 40px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(-1px) scale(0.95);
    backdrop-filter: blur(12px) url(#liquid-glass-distortion);
    /* Distorsion plus forte au clic ? Non, gardons constant */
}


/* ===== BOUTON PRIMARY (Voir mes projets) ===== */
/* Pour qu'il ressorte, on lui donne une teinte colorée MAIS transparente */
.btn-primary {
    color: var(--accent-color);
    border: 1px solid color-mix(in srgb, var(--accent-color) 20%, rgba(255, 255, 255, 0.1));
}

.btn-primary:hover {
    color: var(--accent-color);
    border-color: color-mix(in srgb, var(--accent-color) 40%, rgba(255, 255, 255, 0.3));
    /* Lueur colorée interne */
    background: radial-gradient(circle at center,
            color-mix(in srgb, var(--accent-color) 20%, transparent) 0%,
            transparent 100%);
}

/* ===== BOUTON SECONDARY (Me contacter) ===== */
/* Verre pur incolore */
.btn-secondary {
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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


.btn-icon {
    transition: transform var(--transition-base) var(--ease-out);
}

.btn:hover .btn-icon {
    transform: translateX(4px);
}

.btn-cv .btn-icon {
    transform: translateY(0);
}

.btn-cv:hover .btn-icon {
    transform: translateY(4px);
}

/* Button loading state */
.btn-submit {
    position: relative;
}

.btn-submit.loading .btn-text {
    opacity: 0;
}

.btn-submit.loading .btn-icon {
    opacity: 0;
}

.btn-loader {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.8s linear infinite;
}

.btn-submit.loading .btn-loader {
    opacity: 1;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== CARDS ===== */

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base) var(--ease-out);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* ===== FORM ELEMENTS ===== */

.form-group {
    margin-bottom: var(--space-6);
    position: relative;
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: var(--space-4);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-base);
    transition: all var(--transition-base) var(--ease-out);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(8, 152, 255, 0.1);
}

.form-input.error,
.form-textarea.error {
    border-color: var(--color-error);
}

.form-input.success,
.form-textarea.success {
    border-color: var(--color-success);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-error {
    display: block;
    font-size: var(--text-sm);
    color: var(--color-error);
    margin-top: var(--space-2);
    opacity: 0;
    transform: translateY(-4px);
    transition: all var(--transition-base) var(--ease-out);
}

.form-error.show {
    opacity: 1;
    transform: translateY(0);
}

.form-message {
    padding: var(--space-4);
    border-radius: var(--radius-base);
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition-base) var(--ease-out);
}

.form-message.show {
    opacity: 1;
    transform: translateY(0);
}

.form-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.form-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
    border: 1px solid var(--color-error);
}

/* ===== TAGS ===== */

.tag {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--accent-color);
    background: rgba(255, 51, 153, 0.05);
    /* Very subtle pink background */
    border: 1px solid rgba(255, 51, 153, 0.1);
    border-radius: var(--radius-full);
    transition: all var(--transition-base) var(--ease-out);
}

.tag:hover {
    background: rgba(8, 152, 255, 0.2);
    transform: translateY(-2px);
}

/* ===== MODAL ===== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base) var(--ease-out);
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(var(--blur-base));
    z-index: var(--z-modal-backdrop);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    z-index: var(--z-modal);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-base) var(--ease-out);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-content {
    width: 95%;
    max-width: 1100px;
    height: 85vh;
    display: flex;
    flex-direction: column;
}


.modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(var(--blur-base));
    border-radius: 50%;
    color: white;
    cursor: pointer;
    z-index: 10;
    transition: all var(--transition-base) var(--ease-out);
}

.modal-close:hover {
    background: var(--color-error);
    transform: rotate(90deg);
}

.modal-body {
    padding: 0;
    /* Remove default padding, handled by child */
    overflow: hidden;
    /* Prevent body scroll, we scroll content inside */
    flex: 1;
    /* Fill remaining height */
    display: flex;
}

/* Modal Layout */
.project-modal-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    /* Fallback for mobile */
}

@media (min-width: 768px) {
    .project-modal-layout {
        flex-direction: row;
        overflow-y: hidden;
    }
}

/* Gallery Section (Left/Top) */
.project-gallery {
    flex: 1.2;
    background: #000;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    min-height: 300px;
}

.gallery-main-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.gallery-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.gallery-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
}

.gallery-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
}

/* Gallery Controls */
.gallery-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

.gallery-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.gallery-indicators {
    display: flex;
    gap: 8px;
}

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

.gallery-dot.active {
    background: var(--accent-color);
    transform: scale(1.2);
}

/* Info Section (Right/Bottom) */
.project-info-scroll {
    flex: 1;
    padding: var(--space-8);
    overflow-y: auto;
    background: var(--bg-elevated);
}

.modal-close {
    /* Reposition flush */
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.2);
}

.modal-close:hover {
    background: var(--accent-color);
}

.modal-navigation {
    display: flex;
    justify-content: space-between;
    padding: var(--space-4) var(--space-8);
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.modal-nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
}

.modal-nav-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.modal-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* ===== LOADER ===== */

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-tooltip);
    transition: opacity var(--transition-slow) var(--ease-out);
}

.loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    margin-bottom: var(--space-8);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.loader-logo img {
    max-width: 100%;
    max-height: 100%;
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(59, 130, 246, 0.3));
}

.logo-text {
    font-family: var(--font-display);
    font-size: var(--text-6xl);
    font-weight: var(--font-black);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.loader-progress {
    width: 200px;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.loader-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    animation: loading 2s ease-in-out forwards;
}

@keyframes loading {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

/* ===== CUSTOM CURSOR ===== */

.cursor {
    position: fixed;
    width: var(--cursor-size);
    height: var(--cursor-size);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: var(--z-cursor);
    transition: transform var(--transition-fast) var(--ease-out),
        border-color var(--transition-fast) var(--ease-out);
    mix-blend-mode: difference;
}

.cursor-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--cursor-dot-size);
    height: var(--cursor-dot-size);
    background: var(--accent-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: transform var(--transition-fast) var(--ease-out);
}

.cursor.hover {
    transform: scale(1.5);
    border-color: var(--accent-hover);
}

.cursor.hover .cursor-dot {
    transform: translate(-50%, -50%) scale(0);
}

@media (max-width: 1023px) {
    .cursor {
        display: none;
    }
}

/* ===== SCROLL PROGRESS ===== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-primary);
    z-index: var(--z-fixed);
    transition: width 0.1s linear;
}

/* ===== SOCIAL LINKS ===== */

.social-links {
    display: flex;
    gap: var(--space-4);
}

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

.social-link:hover {
    color: var(--text-inverse);
    background: var(--accent-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-primary);
}

/* ===== TIMELINE ===== */

.timeline-item {
    position: relative;
    padding-left: var(--space-8);
    padding-bottom: var(--space-8);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

/* Legacy vertical link removed to avoid duplication with the new spine */
.timeline-item::before {
    display: none !important;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-dot {
    position: absolute;
    left: 0;
    top: 8px;
    width: 18px;
    height: 18px;
    background: var(--accent-color);
    border: 3px solid var(--bg-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--bg-secondary);
}

.timeline-content {
    background: var(--bg-secondary);
    padding: var(--space-4);
    border-radius: var(--radius-base);
    transition: all var(--transition-base) var(--ease-out);
}

.timeline-content:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.timeline-date {
    display: inline-block;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--accent-color);
    margin-bottom: var(--space-2);
}

.timeline-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}


.timeline-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;

    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    max-width: 80%;
}



/* Timeline is now managed in sections.css */