* {
    box-sizing: border-box;
}

:root {
    --primary-color: #ff9f43;
    --accent-color: #1dd1a1;
    --secondary-color: #54a0ff;
    --bg-color: #fffaf5;
    --text-color: #2d3436;
    --card-bg: #fff;
    --transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body {
    font-family: 'Josefin Sans', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Decoration */
.deco-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.deco-bubble {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    opacity: 0.15;
    filter: blur(1px);
    animation: floatVertical 20s linear infinite;
    animation-delay: var(--delay);
    left: var(--left);
    top: var(--top);
    transform: scale(var(--scale));
    border: 3px solid white;
}

.deco-bubble img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes floatVertical {
    0% { transform: translateY(0) rotate(0deg) scale(var(--scale)); }
    100% { transform: translateY(-120vh) rotate(360deg) scale(var(--scale)); }
}

/* Header - Slimmer */
header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    padding: 0.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--primary-color);
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo img {
    height: 25px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    margin-left: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    transition: var(--transition);
    font-size: 0.85rem;
}

.nav-links a:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Hero Section */
.hero {
    position: relative;
    background: radial-gradient(circle at top left, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.puzzle-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, 40px);
    grid-auto-rows: 40px;
    opacity: 0.4;
    z-index: 0;
    overflow: hidden;
}

.puzzle-tile {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255,255,255,0.4);
    box-sizing: border-box;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

.puzzle-tile.empty {
    visibility: hidden;
}

/* Contrastrijke Frisse Kleuren */
.tile-1 { background-color: #d63031; animation: slideRight 8s infinite alternate ease-in-out; animation-delay: 1s; }
.tile-2 { background-color: #00b894; animation: slideDown 10s infinite alternate ease-in-out; animation-delay: 2s; }
.tile-3 { background-color: #0984e3; animation: slideLeft 12s infinite alternate ease-in-out; animation-delay: 0.5s; }
.tile-4 { background-color: #fdcb6e; animation: slideUp 9s infinite alternate ease-in-out; animation-delay: 3s; }
.tile-5 { background-color: #e17055; animation: slideRight 11s infinite alternate ease-in-out; animation-delay: 1.5s; }

/* Soepele Schuif-Animaties (exact 40px) */
@keyframes slideRight {
    0%, 30% { transform: translateX(0); }
    50%, 80% { transform: translateX(40px); }
    100% { transform: translateX(0); }
}

@keyframes slideLeft {
    0%, 30% { transform: translateX(0); }
    50%, 80% { transform: translateX(-40px); }
    100% { transform: translateX(0); }
}

@keyframes slideDown {
    0%, 30% { transform: translateY(0); }
    50%, 80% { transform: translateY(40px); }
    100% { transform: translateY(0); }
}

@keyframes slideUp {
    0%, 30% { transform: translateY(0); }
    50%, 80% { transform: translateY(-40px); }
    100% { transform: translateY(0); }
}

.hero-title-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 35px;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.hero-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-logo {
    width: 130px;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

.hero h1 {
    margin-bottom: 0;
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: -2px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    line-height: 0.9;
}

.hero-subtitle {
    margin: 10px 0 0 0;
    font-size: 1.4rem;
    font-weight: 400;
    opacity: 0.9;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.search-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 50px;
    max-width: 850px;
    margin: 0 auto 2rem auto;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.5);
}

.language-switcher-hero {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.lang-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 5px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.lang-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.quick-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
}

.filter-chip {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.filter-chip i {
    font-size: 1rem;
    opacity: 1;
}

.filter-chip img {
    height: 1.5em !important;
}

.filter-chip:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    text-shadow: none;
}

.filter-chip.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Main Content */
.search-container input, 
.search-container select {
    padding: 8px 15px;
    border: 2px solid #f0f0f0;
    border-radius: 30px;
    font-size: 0.9rem;
    flex: 1 1 150px;
    outline: none;
}

.btn-search {
    padding: 8px 25px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
}

.btn-reset {
    padding: 8px 15px;
    background-color: #f0f0f0;
    color: #666;
    border-radius: 30px;
    text-decoration: none;
    font-size: 0.85rem;
}

/* Main Content */
.container {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 40px;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--accent-color);
    margin: 8px auto;
    border-radius: 10px;
}

/* Puzzle Grid */
.puzzle-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.puzzle-card {
    width: 220px;
    height: 220px;
    background: white;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    transition: var(--transition);
    animation: floatAnim 6s ease-in-out infinite;
    animation-delay: var(--delay);
    border: 5px solid white;
    cursor: pointer;
}

@keyframes floatAnim {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.puzzle-card:hover {
    transform: scale(1.1) rotate(-2deg);
    box-shadow: 0 0 30px rgba(255, 159, 67, 0.4);
    z-index: 10;
}

.card-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.puzzle-card:hover .card-image img {
    opacity: 0.2;
    transform: scale(1.1);
}

.card-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    text-align: center;
    opacity: 0;
    transform: scale(0.8);
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.85);
}

.puzzle-card:hover .card-content {
    opacity: 1;
    transform: scale(1);
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 0;
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.2;
}

/* Modal Styling - Expanded Dialog */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: var(--bg-color);
    margin: 5vh auto;
    padding: 0;
    border-radius: 40px;
    width: 90%;
    max-width: 1000px;
    position: relative;
    box-shadow: 0 30px 100px rgba(0,0,0,0.3);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

@keyframes popIn {
    from { transform: scale(0.5) translateY(100px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--text-muted);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 100px;
    font-size: 3rem;
    color: var(--primary-color);
}

/* Modal Content Layout */
.modal-detail-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 600px;
}

.modal-gallery {
    background: white;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-main-image {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fdfdfd;
    border-radius: 20px;
    padding: 20px;
}

.modal-main-image img {
    max-width: 100%;
    max-height: 450px;
    border-radius: 10px;
}

.modal-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.modal-thumbnails img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: var(--transition);
}

.modal-thumbnails img:hover {
    border-color: var(--primary-color);
}

.modal-info {
    padding: 60px 40px;
    background: var(--bg-color);
}

.modal-info h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    margin-top: 0;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 2rem;
}

.modal-badge {
    background: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.modal-description {
    line-height: 1.8;
    color: #444;
    font-size: 1.1rem;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 3rem;
    margin-top: 5rem;
    border-top-left-radius: 60px;
    border-top-right-radius: 60px;
}

@media (max-width: 900px) {
    .modal-detail-view { 
        grid-template-columns: 1fr; 
    }
    .modal-content { 
        margin: 0; 
        width: 100%; 
        min-height: 100%; 
        border-radius: 0; 
        overflow: visible; /* Laat scrollen toe via de .modal container */
    }
    .modal-gallery {
        padding: 20px;
    }
    .modal-main-image img {
        max-height: 300px;
    }
    .modal-info {
        padding: 30px 20px;
    }
    .modal-info h1 {
        font-size: 1.8rem;
    }
    .close-modal {
        top: 15px;
        right: 15px;
        background: white;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        font-size: 28px;
        color: var(--primary-color);
        z-index: 100;
    }
    .hero { border-radius: 0; }
    .hero h1 { font-size: 2rem; }
    .section-title { font-size: 1.8rem; }
}
