/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Pokemon-themed colors */
    --primary: #EE1515;
    /* Pokemon Red */
    --primary-dark: #CC0000;
    --secondary: #FFCB05;
    /* Pokemon Yellow */
    --secondary-dark: #F7B500;
    --accent: #3B4CCA;
    /* Pokemon Blue */
    --text: #2C2C2C;
    --text-light: #666666;
    --border: #E0E0E0;
    --bg: #FFFFFF;
    --bg-gray: #F5F5F5;
    --bg-dark: #1A1A1A;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode colors */
/* Dark mode colors - Matching card.php aesthetics */
[data-theme="dark"] {
    --primary: #e53238;
    /* Card.php red */
    --primary-dark: #c72028;
    /* Hover state */
    --secondary: #2ecc71;
    /* Using green as secondary/action color like in card.php */
    --secondary-dark: #27ae60;
    --accent: #3498db;
    /* Blue from badges */
    --text: #ffffff;
    --text-light: #a0a0a0;
    --border: #2a2f3f;
    --bg: #1a1d29;
    /* Card background */
    --bg-gray: #0f1117;
    /* Body background (Deep dark blue/black) */
    --bg-dark: #0f1117;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    /* Deeper shadow from card.php */
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-gray);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header with Pokemon styling */
.site-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-bottom: 4px solid var(--secondary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.logo {
    font-size: 1.75rem;
    font-weight: 900;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.2s;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.theme-toggle {
    background: var(--secondary);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Main Content */
.site-main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Hero Section with card-game styling */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--secondary) 100%);
    border-radius: var(--radius);
    margin-bottom: 3rem;
    color: white;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="3" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 900;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 1.5rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.game-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary);
}

.game-card h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2.5rem 0;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* Set Grid */
.set-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.set-card {
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid var(--border);
}

.set-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.set-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-bottom: 3px solid var(--secondary);
}

.set-info {
    padding: 1.5rem;
}

.set-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.set-name-jp {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.card-count {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1.25rem;
    font-weight: 600;
}

/* Recent Section */
.recent-section {
    margin: 4rem 0;
}

.recent-section h2 {
    font-size: 2.25rem;
    margin-bottom: 2rem;
    color: var(--text);
    position: relative;
    padding-bottom: 0.75rem;
}

.recent-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

/* Buttons with Pokemon styling */
.btn,
.btn-small {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(238, 21, 21, 0.3);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(238, 21, 21, 0.4);
}

.btn-small {
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
}

/* Game Badge */
.game-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
}

/* Enhanced Card Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.card-item {
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    border: 2px solid var(--border);
}

.card-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s;
}

.card-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

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

.card-link {
    text-decoration: none;
    color: var(--text);
    display: block;
}

.card-image {
    width: 100%;
    aspect-ratio: 2.5/3.5;
    object-fit: cover;
    display: block;
}

.card-placeholder {
    width: 100%;
    aspect-ratio: 2.5/3.5;
    background: linear-gradient(135deg, var(--bg-gray), var(--border));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-weight: 600;
}

.card-info {
    padding: 1rem;
}

.card-number {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.card-name {
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.card-rarity {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Footer Enhanced */
.site-footer {
    background: #2a2a2a;
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
    border-top: 4px solid #FFCB05;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: #FFCB05;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin: 0;
}

.footer-section a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
    font-weight: 500;
}

.footer-section a:hover {
    color: #FFCB05;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0.5rem 0;
}

.affiliate-notice {
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        gap: 0.75rem;
        flex-wrap: wrap;
    }


    /* Sets Page Styling */
    .page-header {
        margin-bottom: 2rem;
        text-align: center;
    }

    .page-header h1 {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
        background: linear-gradient(90deg, var(--primary), var(--secondary));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .filter-tabs {
        display: inline-flex;
        background: var(--bg);
        padding: 0.5rem;
        border-radius: 50px;
        border: 1px solid var(--border);
        margin-bottom: 2rem;
    }

    .tab {
        padding: 0.75rem 2rem;
        border-radius: 40px;
        text-decoration: none;
        color: var(--text-light);
        font-weight: 600;
        transition: all 0.3s;
    }

    .tab.active {
        background: var(--primary);
        color: white;
        box-shadow: 0 4px 15px rgba(229, 50, 56, 0.3);
    }

    .tab:hover:not(.active) {
        color: var(--text);
        background: rgba(255, 255, 255, 0.05);
    }

    .sets-list {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .set-row {
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 1.5rem;
        display: grid;
        grid-template-columns: 200px 1fr 150px;
        gap: 2rem;
        align-items: center;
        transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    }

    .set-row:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow);
        border-color: var(--primary);
    }

    .set-thumbnail img {
        width: 100%;
        aspect-ratio: 16/9;
        object-fit: cover;
        border-radius: 8px;
        box-shadow: var(--shadow-sm);
    }

    .set-details h2 {
        margin: 0.5rem 0;
        font-size: 1.5rem;
    }

    .set-details h2 a {
        text-decoration: none;
        color: var(--text);
        transition: color 0.2s;
    }

    .set-details h2 a:hover {
        color: var(--primary);
    }

    .set-meta {
        display: flex;
        gap: 1.5rem;
        color: var(--text-light);
        font-size: 0.9rem;
        margin-top: 0.5rem;
    }

    .set-actions {
        text-align: right;
    }

    @media (max-width: 768px) {
        .set-row {
            grid-template-columns: 1fr;
            text-align: center;
            gap: 1.5rem;
        }

        .set-meta {
            justify-content: center;
        }

        .set-actions {
            text-align: center;
        }

        .set-thumbnail {
            max-width: 300px;
            margin: 0 auto;
        }
    }

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

        .logo-icon {
            font-size: 1.5rem;
        }

        .cards-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }
}