:root {
    --bg-dark: #0a0a1a;
    --bg-light: #f8f9fa;
    --bg-card-dark: rgba(255, 255, 255, 0.05);
    --bg-card-light: #ffffff;
    --primary-gradient: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    --accent-glow: 0 0 15px rgba(0, 210, 255, 0.4);
    --text-main-dark: #ffffff;
    --text-main-light: #212529;
    --text-muted-dark: #a0a0c0;
    --text-muted-light: #6c757d;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Current Theme Variables (Default: Dark) */
    --bg: var(--bg-dark);
    --card: var(--bg-card-dark);
    --text: var(--text-main-dark);
    --muted: var(--text-muted-dark);
    --border: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] {
    --bg: var(--bg-light);
    --card: var(--bg-card-light);
    --text: var(--text-main-light);
    --muted: var(--text-muted-light);
    --border: rgba(0, 0, 0, 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.bg-card {
    background-color: var(--card) !important;
    color: var(--text) !important;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 6px;
}

.theme-toggle:hover {
    transform: rotate(30deg);
    background: var(--primary-gradient);
    color: white;
}

.navbar-toggler {
    color: var(--text);
    font-size: 2rem;
}

/* Back to Top Button */
#backToTop {
    z-index: 1000;
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    display: none;
    border: none;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    cursor: pointer;
    box-shadow: var(--accent-glow);
    transition: var(--transition);
}

#backToTop:hover {
    transform: scale(1.1);
}

/* Navbar Styling */
.navbar {
    background: var(--bg) !important;
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

[data-theme="dark"] .navbar {
    background: rgba(10, 10, 26, 0.8) !important;
    color: var(--text) !important;
}

.logo-text {
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    color: var(--muted) !important;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text) !important;
}

.btn-telegram {
    background: #0088cc;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
    transition: var(--transition);
}

.btn-telegram:hover {
    background: #0099e6;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

/* Hero Section */
.hero-section {
    padding: 100px 0;
    background: radial-gradient(circle at 80% 20%, rgba(0, 210, 255, 0.1) 0%, transparent 50%);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

/* Game List Card (Horizontal) */
.game-list-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

.game-list-card:hover {
    transform: translateX(5px);
    border-color: #00d2ff;
    box-shadow: 0 5px 20px rgba(0, 210, 255, 0.15);
}

.game-rank {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #ff4d4d;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.game-list-logo {
    width: 65px;
    height: 65px;
    aspect-ratio: 1/1;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.game-list-content {
    flex-grow: 1;
    min-width: 0;
}

.game-list-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-list-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.game-info-item {
    font-size: 0.75rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.info-label {
    color: #ff4d4d;
    font-weight: 600;
}

.info-value {
    color: #00d2ff;
    font-weight: 600;
}

.btn-download-list {
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    border-radius: 8px;
    padding: 6px 15px;
    transition: var(--transition);
    text-decoration: none;
    flex-shrink: 0;
    /*animation: glow 1s ease-in-out infinite;*/
}

@keyframes glow {
    0% {
        box-shadow: var(--accent-glow);
        scale: 1;
    }

    50% {
        box-shadow: var(--accent-glow) 0 0 20px;
        scale: 1.1;
    }

    100% {
        box-shadow: var(--accent-glow);
        scale: 1;
    }
}

.btn-download-list:hover {
    filter: brightness(1.1);
    color: white;
    transform: translateY(-2px);
}

/* Game Grid Card */
.game-grid-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.game-grid-card:hover {
    transform: translateY(-10px);
    border-color: #00d2ff;
    box-shadow: 0 10px 30px rgba(0, 210, 255, 0.2);
}

.game-grid-card img {
    width: 100%;
    height: auto;
}

.game-grid-logo {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 15px;
    object-fit: cover;
    margin-bottom: 10px;
}

.game-grid-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text);
    text-align: center;
}

.game-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: var(--muted);
}

.game-info-value {
    font-weight: 600;
    color: var(--text);
}

.btn-download-grid {
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    border-radius: 10px;
    padding: 8px 5px;
    width: 100%;
    margin-top: 10px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
}

.btn-download-grid:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 210, 255, 0.3);
    color: white;
    filter: brightness(1.1);
}

/* 18+ Floating Badge */
.floating-badge {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    z-index: 1000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

@keyframes animate-bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(-10px);
    }
}

.footer {
    background: rgba(199, 199, 199, 0.3);
    padding: 60px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Search Bar */
.search-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 5px 10px;
    display: flex;
    align-items: center;
}

.search-input {
    background: transparent;
    border: none;
    color: inherit;
    padding: 10px 15px;
    width: 100%;
}

.search-input::placeholder {
    color: #999;
}

.search-input:focus {
    outline: none;
}

/* Live Search Dropdown */
.search-wrapper {
    position: relative;
    z-index: 1100;
}

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: var(--card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-height: 450px;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 1100;
}

.search-results-dropdown.show {
    display: block;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    text-decoration: none;
    color: var(--text);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(0, 210, 255, 0.08);
    color: var(--text);
}

.result-logo {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.result-info {
    flex-grow: 1;
    min-width: 0;
    text-align: center;
    padding-right: 60px; /* Offset to center relative to the whole container minus logo */
}

.result-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    color: var(--text);
}

.result-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.result-version {
    font-size: 0.8rem;
    color: #00d2ff;
    font-weight: 600;
    text-transform: capitalize;
}

.no-results {
    padding: 30px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Ultimate Visibility Fix for Accordions - High Contrast */
.accordion-button,
.accordion-button.collapsed {
    background-color: transparent !important;
    color: #ffffff !important; /* Force Solid White */
    opacity: 1 !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    padding: 1.5rem 0 !important;
    box-shadow: none !important;
    border: none !important;
    -webkit-text-fill-color: #ffffff !important;
    transition: all 0.2s ease;
}

[data-theme="dark"] .accordion-button,
[data-theme="dark"] .accordion-button.collapsed {
    color: #ffffff !important;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}

.accordion-button:not(.collapsed) {
    color: #00d2ff !important; /* Vibrant Cyan when open */
    -webkit-text-fill-color: #00d2ff !important;
}

.accordion-button:hover {
    color: #00d2ff !important;
    -webkit-text-fill-color: #00d2ff !important;
    padding-left: 10px !important;
}

.accordion-button::after {
    filter: brightness(2) !important;
    transition: var(--transition);
}

[data-theme="dark"] .accordion-button::after {
    filter: invert(1) brightness(5) !important;
}

.accordion-body {
    color: var(--muted) !important;
    font-size: 1.05rem;
    line-height: 1.8;
    padding: 0 0 1.5rem 0 !important;
    opacity: 1 !important;
}

/* Specific targeting to bypass parent mutes */
article.seo-container .accordion-button,
.card .accordion-button {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* Top Searches Widget */
.top-searches-section {
    padding-top: 0 !important;
}

.top-searches-card {
    background: #f0f7ff;
    border: 1px solid #c5ddf5;
    border-radius: 16px;
    padding: 1.35rem 1.5rem 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

[data-theme="dark"] .top-searches-card {
    background: rgba(58, 123, 213, 0.08);
    border-color: rgba(58, 123, 213, 0.25);
}

.top-searches-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.top-searches-title {
    font-size: clamp(1.05rem, 2.8vw, 1.35rem);
    font-weight: 700;
    color: #0d2b5e;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

[data-theme="dark"] .top-searches-title {
    color: var(--text);
}

.top-searches-icon {
    font-size: 1.15em;
    line-height: 1;
}

.top-searches-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #3a7bd5;
    white-space: nowrap;
}

.top-searches-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem 1.25rem;
}

.top-searches-item {
    margin: 0;
}

.top-searches-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.85rem 0.55rem 0.55rem;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(58, 123, 213, 0.12);
    border-radius: 999px;
    text-decoration: none;
    color: #0d2b5e;
    font-weight: 500;
    font-size: 0.92rem;
    transition: var(--transition);
}

[data-theme="dark"] .top-searches-link {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(58, 123, 213, 0.2);
    color: var(--text);
}

.top-searches-link:hover {
    background: #ffffff;
    border-color: #3a7bd5;
    color: #3a7bd5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58, 123, 213, 0.15);
}

[data-theme="dark"] .top-searches-link:hover {
    background: rgba(58, 123, 213, 0.15);
    color: #00d2ff;
    border-color: #00d2ff;
}

.top-searches-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
}

.top-searches-label {
    line-height: 1.3;
}

@media (max-width: 575.98px) {
    .top-searches-card {
        padding: 1.15rem 1rem 1.25rem;
    }

    .top-searches-list {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .top-searches-header {
        margin-bottom: 1rem;
    }
}

[data-theme="light"] .accordion-button,
[data-theme="light"] .accordion-button.collapsed {
    color: #212529 !important;
    -webkit-text-fill-color: #212529 !important;
}
/* ========================================================
   LIGHT THEME ENHANCEMENTS
   ======================================================== */
[data-theme="light"] {
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] body {
    background-color: #f8fafc;
    color: #0f172a;
}

[data-theme="light"] .game-list-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .game-list-card:hover {
    border-color: #0088cc;
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.12);
}

[data-theme="light"] .game-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .card.bg-card {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .navbar {
    background: #ffffff !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .navbar-brand {
    color: #0088cc !important;
}

[data-theme="light"] .nav-link {
    color: #334155 !important;
}

[data-theme="light"] .nav-link:hover {
    color: #0088cc !important;
}

[data-theme="light"] .theme-toggle {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .search-bar-modern input {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .search-results {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .search-result-item {
    border-bottom: 1px solid #f1f5f9;
}

[data-theme="light"] .search-result-item:hover {
    background: #f8fafc;
}

[data-theme="light"] .search-result-item .result-title {
    color: #0f172a;
}

[data-theme="light"] .footer {
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
}

[data-theme="light"] .text-secondary {
    color: #64748b !important;
}

[data-theme="light"] .hover-white:hover {
    color: #0088cc !important;
}

/* ========================================================
   MOBILE RESPONSIVENESS & ALIGNMENT ENHANCEMENTS
   ======================================================== */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 16px;
        padding: 1.25rem;
        margin-top: 0.75rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    }

    [data-theme="light"] .navbar-collapse {
        background: #ffffff;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    }

    .navbar-nav .nav-item {
        padding: 0.4rem 0;
    }

    .navbar-nav .nav-link {
        font-size: 1.05rem;
        font-weight: 500;
    }

    .navbar-nav .btn-telegram {
        margin-top: 0.5rem;
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .theme-toggle {
        margin-bottom: 0;
    }
}

@media (max-width: 767.98px) {
    .floating-badge {
        bottom: 16px;
        left: 16px;
        width: 44px;
        height: 44px;
        font-size: 0.75rem;
        z-index: 999;
    }

    #backToTop {
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 1rem;
        z-index: 999;
    }

    .hero-section {
        padding: 2.25rem 0 1.25rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .game-list-card {
        padding: 10px 12px;
        gap: 12px;
    }

    .game-list-logo {
        width: 52px;
        height: 52px;
        min-width: 52px;
        border-radius: 12px;
    }

    .btn-download-list {
        padding: 7px 14px;
        font-size: 0.82rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .game-card {
        padding: 1.5rem !important;
    }

    .game-card .game-logo {
        width: 110px !important;
        height: 110px !important;
    }

    .card.bg-card {
        padding: 1.25rem !important;
    }
}
