/* ==========================================================================
   Fluby - Dark Theme Game Portal CSS
   Inspired by CrazyGames.com
   ========================================================================== */

/* ---------- CSS Variables ---------- */
:root {
    --bg-body: #0C0D14;
    --bg-card: #1A1B26;
    --bg-card-hover: #22243A;
    --bg-sidebar: #13141E;
    --bg-navbar: #111220;
    --bg-input: #1E1F2E;
    --bg-elevated: #252738;

    --accent: #3B82F6;
    --accent-hover: #2563EB;
    --accent-glow: rgba(59, 130, 246, 0.35);
    --green: #10B981;
    --green-hover: #059669;
    --red: #EF4444;
    --red-hover: #DC2626;
    --orange: #F59E0B;
    --purple: #8B5CF6;

    --text-primary: #E5E7EB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --text-white: #FFFFFF;

    --border-color: #2A2B3D;
    --border-light: #353750;

    --font-heading: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --sidebar-width: 240px;
    --navbar-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 25px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 20px var(--accent-glow);

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.2;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) var(--bg-body);
}

/* ---------- Navbar ---------- */
.fluby-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--bg-navbar);
    border-bottom: 1px solid var(--border-color);
    z-index: 1040;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    backdrop-filter: blur(10px);
}

.fluby-navbar .navbar-brand {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--text-white);
    letter-spacing: -0.5px;
    white-space: nowrap;
    text-decoration: none;
}

.fluby-navbar .navbar-brand:hover {
    opacity: 0.85;
}

/* Search Bar */
.navbar-search {
    flex: 1;
    max-width: 480px;
    margin: 0 1.5rem;
    position: relative;
}

.navbar-search .search-input {
    width: 100%;
    height: 40px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    padding: 0 1rem 0 2.75rem;
    font-size: 0.875rem;
    outline: none;
    transition: all var(--transition-normal);
}

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

.navbar-search .search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: var(--bg-elevated);
}

.navbar-search .search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.875rem;
}

/* Navbar Actions */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.navbar-actions .btn {
    font-size: 0.875rem;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
}

/* Bootstrap Navbar Dark Overrides */
.navbar.bg-dark,
.navbar[data-bs-theme="dark"] {
    background-color: var(--bg-navbar) !important;
}

.navbar-dark .navbar-nav .nav-link,
.navbar .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar .nav-link:hover {
    color: var(--text-white);
}

.navbar-dark .navbar-nav .nav-link.active,
.navbar .nav-link.active {
    color: var(--accent);
}

/* ---------- Layout ---------- */
.site-wrapper {
    display: flex;
    padding-top: var(--navbar-height);
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0;
    z-index: 1030;
    transition: transform var(--transition-normal);
}

.sidebar-section {
    padding: 0 0.75rem;
    margin-bottom: 1.5rem;
}

.sidebar-heading {
    font-family: var(--font-heading);
    font-size: 0.675rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav .nav-item {
    margin-bottom: 1px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.sidebar-nav .nav-link:hover {
    background: var(--bg-card);
    color: var(--text-white);
}

.sidebar-nav .nav-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
}

.sidebar-nav .nav-link .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-nav .nav-link .nav-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    min-width: 28px;
    text-align: center;
}

/* ---------- Main Content ---------- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    min-width: 0;
}

.main-content.no-sidebar {
    margin-left: 0;
}

/* ---------- Section Headers ---------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-white);
    margin: 0;
}

.section-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.section-link:hover {
    color: var(--accent-hover);
}

/* ---------- Game Grid ---------- */
.game-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 576px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .game-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .game-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1400px) {
    .game-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.game-grid.grid-large {
    grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 576px) {
    .game-grid.grid-large {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .game-grid.grid-large {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---------- Game Card ---------- */
.game-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: 1px solid transparent;
}

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

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

.game-card:hover .game-card-play {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.game-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-elevated);
}

.game-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.game-card:hover .game-card-thumb img {
    transform: scale(1.08);
}

.game-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    display: flex;
    align-items: flex-end;
    padding: 0.75rem;
}

.game-card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    z-index: 2;
}

.game-card-play svg {
    width: 20px;
    height: 20px;
    fill: white;
    margin-left: 2px;
}

/* Game Card Badges */
.game-card-badges {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    gap: 0.375rem;
    z-index: 3;
}

.game-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.4;
}

.game-badge-new {
    background: var(--green);
    color: white;
}

.game-badge-hot {
    background: var(--red);
    color: white;
}

.game-badge-multiplayer {
    background: var(--purple);
    color: white;
}

.game-badge-featured {
    background: var(--orange);
    color: white;
}

/* Game Card Info */
.game-card-info {
    padding: 0.625rem 0.75rem;
}

.game-card-title {
    font-family: var(--font-heading);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-white);
    margin: 0 0 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.game-card-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.game-card-rating .star {
    color: var(--orange);
    font-size: 0.7rem;
}

.game-card-rating .rating-value {
    font-weight: 600;
    color: var(--text-secondary);
}

.game-card-plays {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.game-card a {
    text-decoration: none;
    color: inherit;
}

.game-card a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 4;
}

/* ---------- Featured Carousel ---------- */
.featured-carousel {
    margin-bottom: 2rem;
}

.featured-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 21 / 9;
    background: var(--bg-card);
    cursor: pointer;
}

.featured-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.featured-card:hover img {
    transform: scale(1.03);
}

.featured-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.5rem 1.5rem;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.85) 100%);
}

.featured-card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-white);
    margin: 0 0 0.375rem;
}

.featured-card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-card .btn-play {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.featured-card .btn-play:hover {
    background: var(--accent-hover);
}

/* ---------- Category Quick Links ---------- */
.category-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 576px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .category-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.category-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8125rem;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.category-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--text-white);
    transform: translateY(-2px);
}

.category-card .cat-icon {
    font-size: 1.25rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

/* ---------- Game Player Container ---------- */
.game-player-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 1.5rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.game-player-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
}

.game-player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Loading overlay */
.game-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    z-index: 10;
    transition: opacity var(--transition-slow);
}

.game-loading-overlay.loaded {
    opacity: 0;
    pointer-events: none;
}

/* Controls bar below game */
.game-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.game-controls-bar .game-title-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.game-controls-bar .game-title-area h1 {
    font-size: 1.125rem;
    margin: 0;
}

.game-controls-bar .game-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---------- Rating Buttons ---------- */
.rating-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.rating-btn:hover {
    border-color: var(--border-light);
    color: var(--text-white);
    background: var(--bg-elevated);
}

.rating-btn.upvote:hover,
.rating-btn.upvote.active {
    border-color: var(--green);
    color: var(--green);
    background: rgba(16, 185, 129, 0.1);
}

.rating-btn.downvote:hover,
.rating-btn.downvote.active {
    border-color: var(--red);
    color: var(--red);
    background: rgba(239, 68, 68, 0.1);
}

.rating-btn svg {
    width: 16px;
    height: 16px;
}

/* Fullscreen button */
.btn-fullscreen {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--accent);
    border: none;
    color: white;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.btn-fullscreen:hover {
    background: var(--accent-hover);
}

/* ---------- Game Detail Page ---------- */
.game-detail-section {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.game-detail-section h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.game-description {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.game-description p {
    margin-bottom: 1rem;
}

.game-description h3 {
    font-size: 1rem;
    color: var(--text-white);
    margin: 1.25rem 0 0.5rem;
}

/* Controls grid */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.control-item kbd {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-family: var(--font-body);
    color: var(--text-white);
    min-width: 28px;
    text-align: center;
}

.control-item span {
    color: var(--text-secondary);
}

/* ---------- FAQ Accordion ---------- */
.faq-accordion .accordion-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm) !important;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.faq-accordion .accordion-button {
    background: var(--bg-card);
    color: var(--text-white);
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 1rem 1.25rem;
    box-shadow: none;
    border: none;
}

.faq-accordion .accordion-button:not(.collapsed) {
    background: var(--bg-elevated);
    color: var(--accent);
}

.faq-accordion .accordion-button::after {
    filter: invert(1) brightness(0.7);
}

.faq-accordion .accordion-button:not(.collapsed)::after {
    filter: invert(0.5) sepia(1) saturate(5) hue-rotate(195deg);
}

.faq-accordion .accordion-body {
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
    padding: 0 1.25rem 1rem;
}

/* ---------- Tags ---------- */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.tag-pill:hover {
    background: var(--bg-elevated);
    border-color: var(--accent);
    color: var(--accent);
}

/* ---------- Comments Section ---------- */
.comments-section {
    margin-top: 1rem;
}

.comment-card {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-elevated);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--accent);
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.comment-author {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-white);
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.comment-form textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.comment-form textarea:focus {
    border-color: var(--accent);
}

/* ---------- Search Page ---------- */
.search-hero {
    text-align: center;
    padding: 2rem 0;
}

.search-hero .search-input-lg {
    width: 100%;
    max-width: 600px;
    height: 52px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    padding: 0 1.5rem 0 3rem;
    font-size: 1rem;
    outline: none;
    margin: 0 auto;
    display: block;
    transition: all var(--transition-normal);
}

.search-hero .search-input-lg:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.search-results-count {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 1rem 0;
}

.no-results {
    text-align: center;
    padding: 4rem 1rem;
}

.no-results .no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.no-results h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto;
}

/* ---------- Filter Sidebar ---------- */
.filter-sidebar {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
}

.filter-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.filter-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filter-section h4 {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.filter-section .form-check {
    margin-bottom: 0.375rem;
}

.filter-section .form-check-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.filter-section .form-check-input {
    background-color: var(--bg-input);
    border-color: var(--border-light);
}

.filter-section .form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* ---------- Sort Options ---------- */
.sort-options {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 0.4rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-block;
}

.sort-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-white);
    border-color: var(--border-light);
}

.sort-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumb-dark {
    background: none;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-dark .breadcrumb-item {
    font-size: 0.8125rem;
}

.breadcrumb-dark .breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb-dark .breadcrumb-item a:hover {
    color: var(--accent);
}

.breadcrumb-dark .breadcrumb-item.active {
    color: var(--text-secondary);
}

.breadcrumb-dark .breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
    content: ">";
    font-size: 0.75rem;
}

/* ---------- Pagination ---------- */
.pagination-dark .page-item .page-link {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 0.875rem;
    transition: all var(--transition-fast);
}

.pagination-dark .page-item .page-link:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
    color: var(--text-white);
}

.pagination-dark .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.pagination-dark .page-item.disabled .page-link {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-muted);
    opacity: 0.5;
}

/* ---------- Buttons (Dark Overrides) ---------- */
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.btn-outline-light {
    border-color: var(--border-light);
    color: var(--text-secondary);
}

.btn-outline-light:hover {
    background: var(--bg-elevated);
    border-color: var(--text-muted);
    color: var(--text-white);
}

.btn-dark {
    background: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-dark:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
    color: var(--text-white);
}

/* ---------- Forms (Dark) ---------- */
.form-control, .form-select {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-elevated);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ---------- Loading Spinner ---------- */
.spinner-fluby {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-fluby-sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

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

.loading-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

/* Dots loading animation */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ---------- Toast Notifications ---------- */
.toast-container {
    position: fixed;
    top: calc(var(--navbar-height) + 1rem);
    right: 1rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast-fluby {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 360px;
    animation: toastSlideIn 0.3s ease-out;
}

.toast-fluby.toast-success {
    border-left: 3px solid var(--green);
}

.toast-fluby.toast-error {
    border-left: 3px solid var(--red);
}

.toast-fluby.toast-info {
    border-left: 3px solid var(--accent);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ---------- No Sidebar Page ---------- */
.no-sidebar-page .fluby-footer {
    margin-left: 0;
}

/* ---------- Footer ---------- */
.fluby-footer {
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-left: var(--sidebar-width);
    margin-top: auto;
}

.fluby-footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.fluby-footer .footer-links a {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.fluby-footer .footer-links a:hover {
    color: var(--text-primary);
}

.fluby-footer .footer-copy {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ---------- Page Header ---------- */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.375rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0;
}

/* ---------- Mobile Bottom Nav ---------- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-navbar);
    border-top: 1px solid var(--border-color);
    z-index: 1050;
    padding: 0;
}

.mobile-bottom-nav .bottom-nav-items {
    display: flex;
    height: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-bottom-nav .bottom-nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-bottom-nav .bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.625rem;
    font-weight: 600;
    transition: color var(--transition-fast);
    padding: 0.25rem 0.5rem;
}

.mobile-bottom-nav .bottom-nav-link svg {
    width: 22px;
    height: 22px;
}

.mobile-bottom-nav .bottom-nav-link:hover,
.mobile-bottom-nav .bottom-nav-link.active {
    color: var(--accent);
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

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

.empty-state h3 {
    color: var(--text-primary);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.875rem;
    max-width: 360px;
    margin: 0 auto;
}

/* ---------- Card Skeleton Loader ---------- */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%);
    animation: skeletonShimmer 1.5s infinite;
}

@keyframes skeletonShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.skeleton-thumb {
    aspect-ratio: 16 / 9;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 6px;
    border-radius: 4px;
}

.skeleton-text.short {
    width: 60%;
}

/* ---------- Responsive ---------- */

/* Desktop: hide sidebar toggle */
@media (min-width: 992px) {
    #sidebar-toggle {
        display: none !important;
    }
}

/* Tablet: hide sidebar, expand content */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1025;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .fluby-footer {
        margin-left: 0;
    }
}

/* Mobile */
@media (max-width: 767.98px) {
    .fluby-navbar {
        padding: 0 0.75rem;
    }

    .navbar-search {
        margin: 0 0.75rem;
    }

    .navbar-actions .btn-text {
        display: none;
    }

    .main-content {
        padding: 1rem;
        padding-bottom: 4.5rem; /* Room for bottom nav */
    }

    .mobile-bottom-nav {
        display: block;
    }

    .fluby-footer {
        padding-bottom: 4.5rem;
    }

    .featured-card {
        aspect-ratio: 16 / 9;
    }

    .featured-card-title {
        font-size: 1.125rem;
    }

    .game-grid {
        gap: 0.75rem;
    }

    .game-card-info {
        padding: 0.5rem 0.625rem;
    }

    .game-card-title {
        font-size: 0.75rem;
    }

    .section-title {
        font-size: 1.0625rem;
    }
}

/* Small mobile */
@media (max-width: 374.98px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

/* Large desktop */
@media (min-width: 1600px) {
    .main-content {
        padding: 1.5rem 2rem;
    }
}

/* ---------- Utility Classes ---------- */
.text-accent { color: var(--accent) !important; }
.text-green { color: var(--green) !important; }
.text-red { color: var(--red) !important; }
.text-orange { color: var(--orange) !important; }
.text-purple { color: var(--purple) !important; }

.bg-dark-card { background: var(--bg-card) !important; }
.bg-dark-elevated { background: var(--bg-elevated) !important; }
.bg-dark-body { background: var(--bg-body) !important; }

.border-dark { border-color: var(--border-color) !important; }

.gap-grid { gap: 1rem; }
.gap-sm { gap: 0.5rem; }

.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* Dropdown dark override */
.dropdown-menu {
    background: var(--bg-elevated);
    border-color: var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-item {
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.dropdown-item:hover, .dropdown-item:focus {
    background: var(--bg-card);
    color: var(--text-white);
}

.dropdown-divider {
    border-color: var(--border-color);
}

/* Modal dark override */
.modal-content {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.modal-header {
    border-bottom-color: var(--border-color);
}

.modal-footer {
    border-top-color: var(--border-color);
}

.btn-close {
    filter: invert(1) brightness(0.8);
}

/* Card override for Bootstrap .card */
.card {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.card-header {
    background: var(--bg-elevated);
    border-bottom-color: var(--border-color);
}

/* Alert overrides */
.alert {
    border-radius: var(--radius-md);
}

.alert ul {
    margin: 0;
    padding-left: 1rem;
}

/* Table overrides */
.table {
    color: var(--text-primary);
    border-color: var(--border-color);
}

.table > :not(caption) > * > * {
    background-color: transparent;
    border-bottom-color: var(--border-color);
}

.table-hover > tbody > tr:hover > * {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
}

