/* ==========================================================================
   Drankspelletjes.be - Stylesheet
   ========================================================================== */

/* ==========================================================================
   1. CSS Variables / Design Tokens
   ========================================================================== */

:root {
    /* Colors */
    --primary: #0B1F56;
    --primary-light: #1a3a7d;
    --primary-lighter: #2a4f99;
    --accent: #FF6B35;
    --accent-soft: #FFE4D6;
    
    /* Backgrounds */
    --bg: #FAFBFE;
    --bg-card: #FFFFFF;
    
    /* Text */
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    
    /* Borders */
    --border: #e5e7eb;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(11, 31, 86, 0.04);
    --shadow: 0 4px 6px -1px rgba(11, 31, 86, 0.07), 0 2px 4px -1px rgba(11, 31, 86, 0.04);
    --shadow-lg: 0 10px 25px -3px rgba(11, 31, 86, 0.1), 0 4px 6px -2px rgba(11, 31, 86, 0.05);
    --shadow-xl: 0 20px 40px -5px rgba(11, 31, 86, 0.15);
    
    /* Border Radius */
    --radius: 16px;
    --radius-sm: 10px;
    
    /* Transitions */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   2. Reset & Base Styles
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   3. Header
   ========================================================================== */

header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
    flex-shrink: 0;
}

.logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: contain;
}

.logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--accent);
}

/* Search */
.search-container {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1.25rem 0.875rem 3rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.3);
}

.search-icon {
    position: absolute;
    left: 1.125rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

/* Stats Badge */
.stats-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.stats-badge .count {
    color: var(--accent);
    font-weight: 700;
}

/* ==========================================================================
   4. Hero Section
   ========================================================================== */

.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--primary-lighter) 100%);
    padding: 3rem 2rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    letter-spacing: -1px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   5. Filters Section
   ========================================================================== */

.filters-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filters-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.625rem 1.125rem;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: var(--shadow);
}

.filter-btn .count {
    display: inline-block;
    margin-left: 0.375rem;
    padding: 0.125rem 0.5rem;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 50px;
    font-size: 0.75rem;
}

.filter-btn.active .count {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   6. Main Content
   ========================================================================== */

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem 4rem;
}

.results-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 0 0.25rem;
}

.results-count {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.results-count strong {
    color: var(--text);
}

.clear-filters-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1.5px solid var(--accent);
    border-radius: 50px;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.clear-filters-btn:hover {
    background: var(--accent);
    color: white;
}

/* ==========================================================================
   7. Games Grid
   ========================================================================== */

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* ==========================================================================
   8. Game Card
   ========================================================================== */

.game-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    opacity: 0;
    transition: var(--transition);
}

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

.game-card:hover::before {
    opacity: 1;
}

.game-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.game-card h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.game-category {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    white-space: nowrap;
    flex-shrink: 0;
}

.game-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.game-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.game-meta-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.game-alias {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-light);
    font-style: italic;
}

.game-card-arrow {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 32px;
    height: 32px;
    background: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition);
}

.game-card:hover .game-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================================================
   9. Modal
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 31, 86, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}

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

.modal-header {
    padding: 1.75rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.modal-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-right: 3rem;
    letter-spacing: -0.5px;
}

.modal-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.modal-badge svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-section {
    margin-bottom: 2rem;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.modal-content {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.75;
}

.modal-content p {
    margin-bottom: 1rem;
}

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

.modal-content span {
    font-weight: 600;
    color: var(--primary);
}

.modal-content ul,
.modal-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.modal-content li {
    margin-bottom: 0.5rem;
}

.modal-content a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.modal-content a:hover {
    text-decoration: underline;
}

.benodigdheden-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.benodigdheden-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--bg);
    border-radius: 50px;
    font-size: 0.875rem;
    color: var(--text);
    border: 1px solid var(--border);
}

.benodigdheden-item svg {
    width: 14px;
    height: 14px;
    color: var(--accent);
}

.modal-alias {
    font-style: italic;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ==========================================================================
   10. Empty State
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   11. Footer
   ========================================================================== */

footer {
    background: var(--primary);
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 2rem;
    text-align: center;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
}

.footer-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.footer-logo span {
    color: var(--accent);
}

.footer-text {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-warning {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 107, 53, 0.15);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
}

.footer-credits {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   12. Animations
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card {
    animation: fadeInUp 0.4s ease backwards;
}

.game-card:nth-child(1) { animation-delay: 0.02s; }
.game-card:nth-child(2) { animation-delay: 0.04s; }
.game-card:nth-child(3) { animation-delay: 0.06s; }
.game-card:nth-child(4) { animation-delay: 0.08s; }
.game-card:nth-child(5) { animation-delay: 0.1s; }
.game-card:nth-child(6) { animation-delay: 0.12s; }
.game-card:nth-child(7) { animation-delay: 0.14s; }
.game-card:nth-child(8) { animation-delay: 0.16s; }
.game-card:nth-child(9) { animation-delay: 0.18s; }
.game-card:nth-child(10) { animation-delay: 0.2s; }
.game-card:nth-child(11) { animation-delay: 0.22s; }
.game-card:nth-child(12) { animation-delay: 0.24s; }

/* ==========================================================================
   13. Scrollbar
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ==========================================================================
   14. Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        padding: 1rem;
        gap: 1rem;
    }

    .search-container {
        order: 3;
        max-width: 100%;
        flex-basis: 100%;
    }

    .stats-badge {
        display: none;
    }

    .hero {
        padding: 2rem 1.5rem 3rem;
    }

    .filters-section,
    main {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.4rem;
    }

    .results-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1.25rem;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .filter-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   15. Dice Component
   ========================================================================== */

.dice-component {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1rem;
}

.dice-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.dice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dice-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.dice-controls label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.dice-count-selector {
    display: flex;
    gap: 0.375rem;
}

.dice-count-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    background: white;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.dice-count-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.dice-count-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.dice-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
    min-height: 80px;
}

.dice {
    transition: transform 0.3s ease;
}

.dice.rolling {
    animation: diceRoll 0.3s ease;
}

@keyframes diceRoll {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(0.9); }
    50% { transform: rotate(180deg) scale(1.1); }
    75% { transform: rotate(270deg) scale(0.9); }
    100% { transform: rotate(360deg) scale(1); }
}

.dice-svg {
    filter: drop-shadow(0 2px 4px rgba(11, 31, 86, 0.15));
}

.dice-result {
    text-align: center;
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.dice-result strong {
    color: var(--primary);
    font-size: 1.5rem;
}

.dice-roll-btn {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(11, 31, 86, 0.25);
}

.dice-roll-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(11, 31, 86, 0.35);
}

.dice-roll-btn:active {
    transform: translateY(0);
}

/* Dice indicator on game cards */
.game-dice-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    opacity: 0.7;
}

.game-dice-indicator svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   16. SEO Noscript Fallback Styles
   ========================================================================== */

.noscript-game {
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.noscript-game h2 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.noscript-game p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.noscript-game p:last-child {
    margin-bottom: 0;
}
