/* styles.css */
:root {
    --accent-color: #ff4500;
    --accent-text-color: #ffffff;
    --trending-glow: linear-gradient(135deg, #ff416c, #ff4b2b);
}

[data-bs-theme="light"] {
    --accent-color: #ff4500;
    --accent-text-color: #ffffff;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body[data-bs-theme="dark"] {
    background-color: #0f0f11;
    color: #f0f0f2;
}

body[data-bs-theme="light"] {
    background-color: #f4f5f6;
    color: #1f2026;
}

a,
button,
.thing-card,
.category-link {
    touch-action: manipulation;
}

.navbar {
    min-height: 64px;
    z-index: 1030;
}

body[data-bs-theme="dark"] .navbar {
    background-color: #16161a !important;
    border-bottom: 1px solid #232329 !important;
}

body[data-bs-theme="light"] .navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.navbar-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
    margin-left: 20px;
}

.search-wrapper {
    position: relative;
    max-width: 380px;
    width: 100%;
    margin: 0 auto;
}

.search-icon-left {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    pointer-events: none;
    opacity: 0.65;
    display: inline-flex;
    align-items: center;
}

.nav-search-bar {
    font-size: 0.9rem;
    border-radius: 8px;
    padding-left: 38px;
    padding-right: 36px;
    transition: border 0.15s ease, background-color 0.15s ease;
}

body[data-bs-theme="dark"] .nav-search-bar {
    background-color: #1f2026 !important;
    border: 1px solid #2d2d35 !important;
    color: #ffffff !important;
}

body[data-bs-theme="light"] .nav-search-bar {
    background-color: #f3f4f6 !important;
    border: 1px solid #d1d5db !important;
    color: #1f2026 !important;
}

html body .nav-search-bar:focus {
    border: 2px solid var(--accent-color) !important;
    box-shadow: none !important;
    outline: none !important;
}

.nav-search-bar::placeholder {
    color: #6c727f;
}

.search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c727f;
    font-size: 1rem;
    padding: 2px 6px;
    cursor: pointer;
    display: none;
    border-radius: 4px;
    align-items: center;
    justify-content: center;
}

.search-clear-btn:hover {
    color: #ef4444;
}

.app-main-frame {
    display: flex;
    width: 100%;
    height: calc(100dvh - 64px);
    overflow: hidden;
}

.sidebar-pane {
    width: 240px;
    flex-shrink: 0;
    height: 100%;
    overflow-y: auto;
    border-right: 1px solid #232329;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

body[data-bs-theme="dark"] .sidebar-pane {
    background-color: #141417;
    border-right-color: #232329;
}

body[data-bs-theme="light"] .sidebar-pane {
    background-color: #ffffff;
    border-right-color: #e5e7eb;
}

.theme-toggle-btn {
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle-btn:hover {
    border-color: var(--accent-color) !important;
    color: var(--accent-color) !important;
    background-color: transparent !important;
}

.content-pane {
    flex-grow: 1;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    -webkit-overflow-scrolling: touch;
}

.category-link,
.pseudo-category-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0 14px;
    height: 44px;
    color: #9da3ae;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
    margin-bottom: 4px;
    line-height: 1;
    text-decoration: none;
}

.category-link i,
.pseudo-category-link i {
    font-size: 1.2rem;
}

body[data-bs-theme="light"] .category-link,
body[data-bs-theme="light"] .pseudo-category-link {
    color: #4b5563;
}

.category-link:hover,
.pseudo-category-link:hover {
    background-color: rgba(120, 120, 120, 0.15);
}

body[data-bs-theme="dark"] .category-link:hover,
body[data-bs-theme="dark"] .pseudo-category-link:hover {
    color: #ffffff;
}

body[data-bs-theme="light"] .category-link:hover,
body[data-bs-theme="light"] .pseudo-category-link:hover {
    color: #000000;
}

.category-activated {
    background-color: var(--accent-color) !important;
    color: var(--accent-text-color) !important;
    font-weight: 600;
}

.category-link.cat-btn-trending-tab {
    background: linear-gradient(90deg, rgba(255, 75, 43, 0.08), transparent);
    border-left: 3px solid #ff4b2b;
    color: #ff6b6b;
}

.category-link.cat-btn-trending-tab.category-activated {
    background: var(--trending-glow) !important;
    color: #ffffff !important;
    border-left: 3px solid transparent;
}

.menu-divider {
    height: 1px;
    margin: 12px 8px;
}

body[data-bs-theme="dark"] .menu-divider {
    background-color: #232329;
}

body[data-bs-theme="light"] .menu-divider {
    background-color: #e5e7eb;
}

.shelf-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.shelf-title i {
    font-size: 1.4rem;
}

html body .thing-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid transparent !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.1s ease, border-width 0.1s ease;
}

body[data-bs-theme="dark"] .thing-card {
    background-color: #16161a !important;
    border-color: #232329 !important;
}

body[data-bs-theme="light"] .thing-card {
    background-color: #ffffff !important;
    border-color: #e5e7eb !important;
}

@media (hover: hover) {
    html body .thing-card:hover {
        transform: translateY(-4px);
        border: 3px solid var(--accent-color) !important;
    }
}

.thing-card:active {
    transform: scale(0.98);
}

body[data-bs-theme="dark"] .thing-card:active {
    background-color: #1f2026 !important;
}

body[data-bs-theme="light"] .thing-card:active {
    background-color: #f3f4f6 !important;
}

.thing-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

body[data-bs-theme="dark"] .thing-card img {
    border-bottom: 1px solid #232329;
}

body[data-bs-theme="light"] .thing-card img {
    border-bottom: 1px solid #e5e7eb;
}

.card-title-custom {
    font-size: 14pt !important;
    font-weight: 600 !important;
    word-break: break-word;
    line-height: 1.25;
}

.game-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 6px;
    z-index: 3;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    line-height: 1;
}

.badge-new {
    background-color: #10b981;
    color: #ffffff;
}

.badge-desktop-only {
    background-color: #ef4444;
    color: #ffffff;
}

.badge-featured {
    background-color: #a855f7;
    color: #ffffff;
}

.site-footer {
    border-top: 1px solid #232329;
    padding: 20px;
    margin-top: auto;
}

body[data-bs-theme="dark"] .site-footer {
    background-color: #141417;
    border-top-color: #232329;
}

body[data-bs-theme="light"] .site-footer {
    background-color: #ffffff;
    border-top-color: #e5e7eb;
}

.mirror-link {
    font-size: 0.85rem;
    color: #8a8d98;
    text-decoration: none;
    padding: 6px 12px;
    transition: color 0.2s ease, background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
}

.mirror-link::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    opacity: 0.7;
}

.mirror-link:hover {
    color: var(--accent-text-color);
    background-color: rgba(120, 120, 120, 0.15);
}

#trending-games {
    color: #ff416c;
}

.quick-exit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.15s ease;
    white-space: nowrap;
    margin-right: 10px;
}

body[data-bs-theme="dark"] .quick-exit-btn {
    background-color: #1f2026;
    border: 1px solid #2d2d35;
    color: #ef4444;
}

body[data-bs-theme="light"] .quick-exit-btn {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #dc2626;
}

.quick-exit-btn:hover {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
}

.quick-exit-btn i {
    font-size: 1.1rem;
}

.clear-continue-btn {
    background: none;
    border: none;
    color: #6c727f;
    font-size: 1.2rem;
    padding: 0;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.2s ease, transform 0.2s ease;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.clear-continue-btn:hover {
    color: #ef4444;
    transform: scale(1.1);
}

@media (max-width: 767.98px) {
    .navbar {
        padding: 0.5rem 0.5rem !important;
    }
    .navbar-brand img {
        height: 24px;
    }
    .search-wrapper {
        max-width: 150px;
    }
    .nav-search-bar {
        font-size: 0.8rem;
        padding-left: 28px;
        padding-right: 20px;
    }
    .search-icon-left {
        left: 6px;
        font-size: 0.85rem;
    }
    .search-clear-btn {
        right: 2px;
        font-size: 0.85rem;
    }
    .quick-exit-btn {
        padding: 0.25rem 0.75rem;
        font-size: 0.8rem;
        margin-right: 5px;
    }
}

.sidebar-pane::-webkit-scrollbar,
.content-pane::-webkit-scrollbar {
    width: 4px;
}

.sidebar-pane::-webkit-scrollbar-track,
.content-pane::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-pane::-webkit-scrollbar-thumb,
.content-pane::-webkit-scrollbar-thumb {
    background: #2d2d35;
    border-radius: 4px;
}