/* --- 1. BASE STYLES --- */
:root {
    --bg-color: #0d0d0d;
    --card-bg: #1c1c1e;
    --text-main: #f5f5f7;
    --text-muted: #86868b;
    --accent: #2997ff;
    --gap: 20px;
    --overlay-start: rgba(0,0,0,0.85);
    --overlay-end: rgba(0,0,0,0.3);
    --terminal-bg: #000;
    --shadow: rgba(0,0,0,0.2);
}

/* Light mode colors */
[data-theme="light"] {
    --bg-color: #f5f5f7;
    --card-bg: #ffffff;
    --text-main: #1d1d1f;
    --text-muted: #6e6e73;
    --accent: #0071e3;
    --overlay-start: rgba(0,0,0,0.75);
    --overlay-end: rgba(0,0,0,0.2);
    --terminal-bg: #f5f5f7;
    --shadow: rgba(0,0,0,0.1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 20px;
    padding-bottom: 0;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- 2. GRID CONFIGURATIE --- */
.bento-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
    grid-auto-rows: minmax(260px, auto);
    margin-bottom: 80px;
}

/* --- 3. ALGEMENE CARD STYLING --- */
.card {
    background-color: var(--card-bg);
    border-radius: 28px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px var(--shadow);
}

[data-theme="light"] .card {
    border: 1px solid #e5e5e7;
}
.card:hover { transform: scale(1.02); z-index: 5; }

/* Tekst & Plaatjes */
.tag { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; display: block; letter-spacing: 0.05em; }
h1 { font-size: 2.8rem; font-weight: 700; line-height: 1.1; margin-bottom: 15px; color: #fff; }
h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 5px; color: #fff; }
p { color: var(--text-muted); line-height: 1.5; font-size: 1rem; }

/* Dark mode: witte tekst op image cards */
.item-salt h2,
.item-salt p {
    color: #fff;
}

.item-salt .tag {
    color: rgba(255,255,255,0.9);
}

/* Light mode: donkere tekst op lichte achtergrond */
[data-theme="light"] h1,
[data-theme="light"] h2 {
    color: #1d1d1f;
}

/* Light mode: specifieke overrides voor cards met achtergrondafbeeldingen */
[data-theme="light"] .item-hero h1,
[data-theme="light"] .item-hero p,
[data-theme="light"] .item-app h2,
[data-theme="light"] .item-app p,
[data-theme="light"] .item-webshop h2,
[data-theme="light"] .item-webshop p,
[data-theme="light"] .item-runner h2,
[data-theme="light"] .item-mtb h2,
[data-theme="light"] .item-skier h2,
[data-theme="light"] .item-coach h2,
[data-theme="light"] .item-house h2,
[data-theme="light"] .item-house p,
[data-theme="light"] .item-football h2,
[data-theme="light"] .item-football p,
[data-theme="light"] .item-salt h2,
[data-theme="light"] .item-salt p {
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Extra text shadow voor kleine sport cards voor betere leesbaarheid */
[data-theme="light"] .item-runner h2,
[data-theme="light"] .item-mtb h2,
[data-theme="light"] .item-skier h2,
[data-theme="light"] .item-coach h2,
[data-theme="light"] .item-football h2 {
    text-shadow: 0 2px 12px rgba(0,0,0,0.7);
}

/* Tags op image cards ook wit maken in light mode */
[data-theme="light"] .item-hero .tag,
[data-theme="light"] .item-app .tag,
[data-theme="light"] .item-webshop .tag,
[data-theme="light"] .item-runner .tag,
[data-theme="light"] .item-mtb .tag,
[data-theme="light"] .item-skier .tag,
[data-theme="light"] .item-coach .tag,
[data-theme="light"] .item-house .tag,
[data-theme="light"] .item-football .tag,
[data-theme="light"] .item-salt .tag {
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.card-content { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; }
.bottom-content { margin-top: auto; }
.center-content { justify-content: center; align-items: center; text-align: center; }

.card-bg-img { position: absolute; inset: 0; width: 115%; height: 115%; left: -7.5%; top: -7.5%; object-fit: cover; z-index: 0; transition: transform 0.6s ease; }
.card:hover .card-bg-img { transform: scale(1.05); }
.overlay { position: absolute; inset: 0; background: linear-gradient(to right, var(--overlay-start) 0%, var(--overlay-end) 100%); z-index: 1; }


/* --- 4. PUZZEL POSITIES (Aangepaste volgorde) --- */

/* DEEL 1: TOP (Hero & Work) */
.item-hero { grid-column: span 3; grid-row: span 2; background: #000; }
.hero-text { justify-content: center; height: 100%; display: flex; flex-direction: column; }

.item-work { grid-column: span 1; grid-row: span 2; overflow-y: auto; }
.timeline { display: flex; flex-direction: column; gap: 15px; margin-top: auto; }
.job-item { border-left: 2px solid #333; padding-left: 15px; position: relative; }
[data-theme="light"] .job-item { border-left-color: #d2d2d7; }
.job-item::before { content: ''; position: absolute; left: -5px; top: 6px; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }
.job-role { display: block; font-weight: 600; color: #fff; margin-bottom: 2px;}
.job-date { font-size: 0.8rem; color: var(--text-muted); }

[data-theme="light"] .job-role {
    color: #1d1d1f;
}

/* DEEL 2: TECH & APP */
.item-app { grid-column: span 2; grid-row: span 2; background: #080808; overflow: hidden; }
[data-theme="light"] .item-app { background: #1a1a1a; }
.item-app .card-bg-img { width: 100%; height: 100%; left: 0; top: 0; }
.app-mockup { position: absolute; width: 220px; bottom: 10px; right: 10px; transform: rotate(-8deg); box-shadow: -20px 20px 50px rgba(0,0,0,0.6); border-radius: 30px; z-index: 1; transition: transform 0.4s ease; }
.item-app:hover .app-mockup { transform: rotate(-5deg) translateY(-10px) scale(1.04); }

.app-links {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.app-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.app-link:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.app-link svg {
    transition: transform 0.3s ease;
}

.app-link:hover svg {
    transform: scale(1.1);
}

.item-tech { grid-column: span 2; grid-row: span 1; background: var(--terminal-bg); font-family: "SF Mono", "Fira Code", monospace; }
[data-theme="light"] .item-tech { border: 1px solid #d2d2d7; }
.terminal-header { display: flex; gap: 6px; margin-bottom: 20px; }
.terminal-dot { width: 12px; height: 12px; border-radius: 50%; background: #555; }
.terminal-dot:nth-child(1) { background: #ff5f56; }
.terminal-dot:nth-child(2) { background: #ffbd2e; }
.terminal-dot:nth-child(3) { background: #27c93f; }
.terminal-body { text-align: left; }
.terminal-line { display: flex; align-items: center; }
.terminal-prompt { color: var(--text-muted); margin-right: 10px; }
.terminal-text::after { content: "▋"; animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.item-github {
    grid-column: span 2;
    grid-row: span 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.item-github::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.item-github h2,
.item-github .tag {
    color: white;
    position: relative;
    z-index: 2;
}

.github-button {
    color: white;
    background: rgba(255,255,255,0.2);
    padding: 14px 28px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.github-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.github-icon {
    transition: transform 0.3s ease;
}

.github-button:hover .github-icon {
    transform: rotate(360deg);
}

[data-theme="light"] .item-github {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.small-link { color: var(--accent); text-decoration: none; font-size: 1rem; font-weight: 600; }

/* DEEL 3: WEBSHOP & SPOTIFY & SPORT (Het middenstuk) */
.item-webshop { grid-column: span 2; grid-row: span 2; } /* Nu hier! */
.item-spotify { grid-column: span 1; grid-row: span 2; padding: 0; background: #000; min-height: 540px; }
.item-runner { grid-column: span 1; grid-row: span 1; }
.item-mtb { grid-column: span 1; grid-row: span 1; }

/* DEEL 4: KLEINE ITEMS (Tussenlaag) */
.item-skier { grid-column: span 1; grid-row: span 1; }
.item-coach { grid-column: span 1; grid-row: span 1; }
.item-football { grid-column: span 2; grid-row: span 1; background: var(--card-bg); }

/* DEEL 5: BODEM (House & Briancon & Salt) */
.item-house { grid-column: span 2; grid-row: span 2; } /* Helemaal onderaan */
.item-house .card-bg-img { width: 115%; height: 135%; left: -7.5%; top: -17.5%; } /* Extra buffer voor scroll parallax effect */
.item-briancon { grid-column: span 2; grid-row: span 2; background: var(--card-bg); } /* Helemaal onderaan */
.item-salt {
    grid-column: span 4;
    grid-row: span 1;
    min-height: 250px;
}

.item-salt .card-bg-img {
    object-fit: cover;
    object-position: 0% 100%;
    width: 115%;
    height: 115%;
    left: -7.5%;
    top: -7.5%;
}

.item-salt .overlay {
    background: linear-gradient(to right, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 100%);
}

/* Carousel styling */
.carousel-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.carousel-img {
    opacity: 0;
    transition: opacity 1s ease-in-out;
    pointer-events: none;
}

.carousel-img.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-dots {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    justify-content: flex-start;
}

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

.carousel-dot.active {
    background: rgba(255,255,255,0.9);
    transform: scale(1.2);
}

.carousel-dot:hover {
    background: rgba(255,255,255,0.7);
}

/* Responsive video container */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin-top: 15px;
    border-radius: 12px;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}


/* --- 5. MARQUEE & FOOTER --- */
.marquee-section {
    background: #111;
    padding: 40px 0;
    overflow: hidden;
    white-space: nowrap;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    transition: background 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .marquee-section {
    background: #ffffff;
    border-top: 1px solid #d2d2d7;
    border-bottom: 1px solid #d2d2d7;
}

.marquee-wrapper {
    display: flex;
    gap: 80px;
}

.marquee-content {
    display: inline-flex;
    align-items: center;
    gap: 80px;
    animation: scroll 40s linear infinite;
}

.logo-item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

[data-theme="light"] .logo-item {
    background: rgba(0,0,0,0.03);
}

.logo-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

[data-theme="light"] .logo-item:hover {
    background: rgba(0,0,0,0.06);
}

.logo-item svg {
    width: 32px;
    height: 32px;
    fill: #fff;
    transition: transform 0.3s ease;
}

[data-theme="light"] .logo-item svg {
    fill: #1d1d1f;
}

.logo-item:hover svg {
    transform: scale(1.1);
}

.logo-item span {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

[data-theme="light"] .logo-item span {
    color: #1d1d1f;
}

@keyframes scroll {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-100% - 80px)); }
}

.contact-footer { text-align: center; padding: 100px 20px; background: var(--bg-color); width: 100vw; margin-left: calc(-50vw + 50%); }
.cta-button { display: inline-block; margin-top: 30px; padding: 18px 40px; font-size: 1.1rem; background: var(--accent); color: #fff; text-decoration: none; border-radius: 50px; font-weight: 600; transition: transform 0.2s; }
.cta-button:hover { transform: scale(1.05); }

/* --- 6. THEME TOGGLE --- */
.theme-toggle {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: var(--card-bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--shadow);
    z-index: 1000;
    transition: transform 0.2s ease, background 0.3s ease;
}

[data-theme="light"] .theme-toggle {
    border: 1px solid #e5e5e7;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-icon {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(20deg);
}

/* --- 7. LIGHTBOX --- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.8);
    animation: zoomIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 48px;
    font-weight: 300;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 10000;
}

.lightbox-close:hover {
    transform: scale(1.1);
}

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

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

/* --- CV BUTTON & MODAL --- */
.cv-button {
    margin-top: 20px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.cv-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.cv-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
}

.cv-modal.active {
    display: flex;
    animation: fadeIn 0.3s forwards;
}

.cv-modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.cv-modal-content h2 {
    margin: 0 0 8px 0;
    color: var(--text);
    font-size: 28px;
}

.cv-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 32px;
    color: var(--text);
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 10000;
}

.cv-modal-close:hover {
    transform: scale(1.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

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

.cv-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.cv-submit-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.cv-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- 8. MOBILE --- */
@media (max-width: 900px) {
    /* Smooth scroll behavior */
    html {
        scroll-behavior: smooth;
    }

    body {
        overflow-x: hidden;
    }

    /* Optimize performance */
    .card {
        will-change: transform;
    }

    .theme-toggle {
        top: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }
    .theme-icon {
        font-size: 20px;
    }
    .bento-container {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 24px; /* Iets meer ruimte tussen cards op mobiel */
    }

    .item-hero, .item-work, .item-tech, .item-github, .item-app, .item-webshop, .item-house, .item-runner, .item-mtb, .item-skier, .item-coach, .item-spotify, .item-briancon, .item-football, .item-salt {
        grid-column: span 1 !important;
        grid-row: auto !important;
        min-height: 320px;
        border-radius: 24px; /* Iets minder extreme radius op mobiel */
    }
    .item-spotify { min-height: 450px; }
    .item-tech, .item-github, .item-football { min-height: 220px; }
    .app-mockup { width: 220px; right: -20px; bottom: -30px; }

    .lightbox-content {
        max-width: 95%;
        max-height: 85vh;
    }

    .lightbox-close {
        top: 20px;
        right: 20px;
        font-size: 36px;
    }

    /* CV Modal op mobiel: Slide-up effect */
    .cv-modal-content {
        max-width: 100%;
        width: 100%;
        border-radius: 24px 24px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        max-height: 85vh;
        overflow-y: auto;
    }

    .cv-modal.active .cv-modal-content {
        animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

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