:root {
    --bg-primary: #0a0a14;
    --bg-secondary: #161623;
    --accent: #6d28d9;
    --accent-hover: #7c3aed;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(22, 22, 35, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.background-animation {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(109, 40, 217, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 20% 80%, rgba(37, 99, 235, 0.1) 0%, transparent 40%);
    z-index: -1;
    animation: pulse 15s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1) translate(-2%, -2%); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    color: var(--accent);
    background: none;
    -webkit-text-fill-color: var(--accent);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 300;
}

.search-section {
    max-width: 650px;
    margin: 0 auto 4rem auto;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.search-box {
    display: flex;
    gap: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 0.5rem;
    border-radius: 99px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.search-box:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(109, 40, 217, 0.25);
    border-color: rgba(109, 40, 217, 0.4);
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    padding-left: 1.5rem;
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    margin-right: 1rem;
}

#search-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1.1rem;
    outline: none;
}

#search-input::placeholder {
    color: var(--text-muted);
}

#search-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 99px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#search-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 20px rgba(109, 40, 217, 0.4);
}

#search-btn:active {
    transform: scale(0.96);
}


.tabs-header {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.tab-btn {
    background: var(--glass-bg);
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    padding: 0.7rem 2rem;
    border-radius: 99px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.tab-btn:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.15);
}

.tab-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(109, 40, 217, 0.3);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

.official-stores-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.official-store-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeIn 0.5s ease-out backwards;
}

.official-store-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
}

.official-store-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.official-store-name {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
}

.section-divider {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
    text-align: center;
    margin: 1.5rem 0 0.5rem 0;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.game-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    animation: fadeIn 0.5s ease-out backwards;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-bottom: 1px solid var(--glass-border);
}

.card-content {
    padding: 1.5rem;
}

.game-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.store-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.store-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: contain;
    background: white;
    padding: 2px;
}

.price-container {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.sale-price {
    font-size: 1.75rem;
    font-weight: 800;
    color: #4ade80;
}

.normal-price {
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.savings {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.get-deal-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    text-decoration: none;
    padding: 0.8rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.get-deal-btn:hover {
    background: white;
    color: var(--bg-primary);
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.site-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    animation: fadeIn 0.5s ease-out backwards;
}

.site-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.site-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
}

.site-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.site-search-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    text-decoration: none;
    padding: 0.7rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: inherit;
}

.site-search-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}


.hidden {
    display: none !important;
}

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

#empty-state p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.google-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    text-decoration: none;
    padding: 0.9rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: inherit;
}

.google-search-btn:hover {
    background: rgba(66, 133, 244, 0.2);
    border-color: rgba(66, 133, 244, 0.4);
    box-shadow: 0 0 20px rgba(66, 133, 244, 0.2);
    transform: translateY(-2px);
}

.google-search-btn svg {
    flex-shrink: 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(109, 40, 217, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem auto;
}

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

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

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

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


@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
        border-radius: 20px;
        padding: 1rem;
    }
    
    #search-btn {
        width: 100%;
    }
    
    .logo { font-size: 2.5rem; }

    .tabs-header {
        gap: 0.3rem;
    }

    .tab-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }

    .sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .official-stores-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}
