/*
 * ============================================================
 * ⚠️  LLM/AI CODING ASSISTANT WARNING ⚠️
 * ============================================================
 * 
 * THIS IS THE SINGLE SOURCE OF TRUTH FOR ALL CSS STYLES.
 * 
 * RULES:
 * 1. NEVER add inline styles to templates
 * 2. NEVER use btn-dark (it's permanently banned and will be blue)
 * 3. ALWAYS use btn-primary (blue) for default buttons
 * 4. Use btn-success (green) for SAVE actions only
 * 5. Use btn-danger (red) for DELETE/WARNING actions only
 * 6. Links MUST use the standard link color (#58A6FF)
 * 7. SEARCH this file for existing styles before creating new ones
 * 8. When adding new styles, add them to the appropriate section
 * 
 * ============================================================
 */

/* ===========================================
   CSS VARIABLES - DEFAULT DARK THEME
   These can be overridden by dynamic PHP in store.php
   =========================================== */
:root {
    /* Site & Card Backgrounds */
    --site-background: #212529;
    --site-bg: #212529;
    --card-background: #343a40;
    --card-bg: #2b3035;
    --card-text: #f8f9fa;

    /* Text Colors */
    --header-text: #ffffff;
    --header-color: #ffffff; /* alias for --header-text */
    --price-text: #c8fbfd;
    --sale-price-text: #dc3545;

    /* Link Colors - STANDARD BLUE */
    --link-color: #58A6FF;
    --link-hover-color: #79bbff;
    --link-hover: #79bbff; /* alias for --link-hover-color */

    /* Button Colors - Blue Primary */
    --btn-primary-bg: #0d6efd;
    --btn-primary-text: #ffffff;
    --btn-primary-hover: #0b5ed7;
    --btn-hover-text: #ffffff;
    --btn-color: #0d6efd; /* alias for --btn-primary-bg */
    --btn-hover: #0b5ed7; /* alias for --btn-primary-hover */

    /* Sale Badge */
    --sale-badge-bg: #dc3545;
    --sale-badge-text: #ffffff;

    /* Highlight */
    --highlight-border: #ffc107;

    /* Layout */
    --content-max-width: 1320px;
    --content-padding: 1.5rem;

    /* Store Page Theme */
    --store-gradient-top: #1a1d29;
    --store-gradient-mid: #1e1a2e;
    --store-gradient-bottom: #1a1d29;
    --store-stripe-strong: rgba(88, 166, 255, 0.4);
    --store-stripe-soft: rgba(88, 166, 255, 0.1);
    --store-stripe-segment: 2080px;
    --store-gradient-overlay-color: #1a1d29;
    --store-stripe-overlay-color: #58a6ff;
}


/* ===========================================
   UNIVERSAL LINK STYLING
   One consistent link style for the entire site
   =========================================== */
a:not(.btn):not(.nav-link) {
    color: var(--link-color) !important;
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

a:not(.btn):not(.nav-link):hover {
    color: var(--link-hover-color) !important;
    text-decoration: underline;
}

a:not(.btn):not(.nav-link):visited {
    color: var(--link-color) !important;
}


/* ===========================================
   UNIVERSAL BUTTON TEXT COLOR
   All buttons must have white text
   =========================================== */
.btn,
a.btn,
a.btn:hover,
a.btn:visited,
a.btn:focus,
a.btn:active,
.btn:hover,
.btn:focus,
.btn:active {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Standardized button heights */
.btn {
    min-height: 38px;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}


/* ===========================================
   UNIVERSAL BUTTON STYLING
   Blue default, Green save, Red delete
   =========================================== */

/* Primary Button - Blue (Default) */
.btn-primary {
    background-color: var(--btn-primary-bg) !important;
    border-color: var(--btn-primary-bg) !important;
    color: var(--btn-primary-text) !important;
}

.btn-primary:hover {
    background-color: var(--btn-primary-hover) !important;
    border-color: var(--btn-primary-hover) !important;
    color: var(--btn-hover-text) !important;
}

/* ============================================================
   🚫 btn-dark IS PERMANENTLY BANNED 🚫
   This rule forcibly converts ANY btn-dark to blue (btn-primary)
   DO NOT REMOVE THIS RULE UNDER ANY CIRCUMSTANCES
   ============================================================ */
.btn-dark,
.btn-dark:hover,
.btn-dark:focus,
.btn-dark:active,
.btn-outline-dark,
.btn-outline-dark:hover,
.btn-outline-dark:focus,
.btn-outline-dark:active {
    background-color: var(--btn-primary-bg) !important;
    border-color: var(--btn-primary-bg) !important;
    color: var(--btn-primary-text) !important;
}

.btn-dark:hover,
.btn-dark:focus,
.btn-outline-dark:hover,
.btn-outline-dark:focus {
    background-color: var(--btn-primary-hover) !important;
    border-color: var(--btn-primary-hover) !important;
}


/* ===========================================
   GLOBAL SITE STYLES
   =========================================== */
body {
    background-color: var(--site-background) !important;
    color: var(--card-text);
    overflow-x: hidden;
}

.main-content {
    background-color: var(--site-bg);
}

/* Home and Store pages: gradient background with vertical dividers */
body.home-body,
body.store-page {
    background: var(--site-bg) !important;
    position: relative;
    min-height: 100vh;
}

/* Vertical dividers on large screens for store page and home page */
@media (min-width: 1200px) {
    body.store-page::before,
    body.home-body::before {
        content: '';
        position: fixed;
        left: calc((100vw - min(var(--content-max-width), calc(100vw - (var(--content-padding) * 2)))) / 2);
        top: 0;
        width: 4px;
        height: 100%;
        background: linear-gradient(to bottom, transparent, rgba(88, 166, 255, 0.4), rgba(88, 166, 255, 0.1), rgba(88, 166, 255, 0.4), transparent);
        z-index: 1;
        pointer-events: none;
    }

    body.store-page::after,
    body.home-body::after {
        content: '';
        position: fixed;
        right: calc((100vw - min(var(--content-max-width), calc(100vw - (var(--content-padding) * 2)))) / 2);
        top: 0;
        width: 4px;
        height: 100%;
        background: linear-gradient(to bottom, transparent, rgba(88, 166, 255, 0.4), rgba(88, 166, 255, 0.1), rgba(88, 166, 255, 0.4), transparent);
        z-index: 1;
        pointer-events: none;
    }
}

/* ===========================================
   CARD STYLING
   =========================================== */
.card {
    background-color: var(--card-background);
    color: var(--card-text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    overflow: visible;
}

#game-gallery .card {
    overflow: visible !important;
}

/* Match image top corners to card corners in Details/Thumbnail views */
#game-gallery .card .card-img-top {
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

#game-gallery .card .ratio {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.card-header {
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Pricing card alignment */
.pricing-meta-block {
    min-height: 48px;
}

.pricing-original-price {
    font-size: 1.15rem;
    line-height: 1.1;
}

.pricing-sale-price {
    color: var(--sale-price-text);
    font-weight: 700;
}

.bg-card-standard {
    background-color: var(--card-background) !important;
    color: var(--card-text);
}


/* ===========================================
   HEADER & TEXT STYLING
   =========================================== */
.card-title,
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
.display-4,
.lead,
.text-muted {
    color: var(--header-text) !important;
}

.mechanic-tag-link {
    color: var(--link-color) !important;
    letter-spacing: normal !important;
    font-size: 0.95rem !important;
    font-weight: 500;
}


/* ===========================================
   FORM CONTROLS - DARK THEME
   =========================================== */
.form-control,
.form-select {
    background-color: #212529 !important;
    border-color: #495057 !important;
    color: #fff !important;
}

.form-control:focus,
.form-select:focus {
    background-color: #212529 !important;
    color: #fff !important;
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, .25) !important;
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
    background-color: var(--card-background) !important;
    border-color: #495057 !important;
    color: #fff !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #fff !important;
}

.icon-choice-btn {
    background-color: #212529 !important;
    border-color: #495057 !important;
    color: #ffffff !important;
}

.icon-choice-btn:hover {
    background-color: #1b1f23 !important;
    border-color: #6c757d !important;
}

.btn-check:checked + .icon-choice-btn {
    background-color: rgba(13, 110, 253, 0.18) !important;
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

/* Remove rounded corners from dropdown options */
.form-select option {
    background-color: #212529;
    color: #fff;
    border-radius: 0 !important;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
}

/* Firefox-specific fix for dropdown styling */
@-moz-document url-prefix() {
    .form-select {
        text-overflow: ellipsis;
    }
    .form-select option {
        border-radius: 0 !important;
    }
}

#search-input {
    background-color: #212529 !important;
    border: 2px solid color-mix(in srgb, var(--btn-primary-bg) 70%, #ffffff 30%) !important;
    color: #ffffff !important;
    border-radius: 5px !important;
    background-image: none !important;
}

#countryFilter {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-radius: 5px !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

#search-input:focus,
#countryFilter:focus {
    background-color: #212529 !important;
    box-shadow: 0 0 0 0.12rem color-mix(in srgb, var(--btn-primary-bg) 45%, transparent) !important;
    color: #ffffff !important;
}

#search-input:focus {
    border-color: var(--btn-primary-bg) !important;
}

#countryFilter:focus {
    border-color: var(--btn-primary-bg) !important;
}

#search-input::placeholder,
.home-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}


/* ===========================================
   LIST GROUP ITEMS
   =========================================== */
.list-group-item {
    background-color: transparent !important;
    color: inherit !important;
    font-size: 1.05rem;
}

.list-group-item strong {
    font-weight: 800 !important;
    color: var(--header-text) !important;
    font-size: 0.85rem;
}

/* ===========================================
   FORCED OVERRIDES
   =========================================== */
.text-uppercase {
    text-transform: none !important;
}

.font-monospace {
    font-family: inherit !important;
}

.small,
small {
    font-size: inherit !important;
}

.text-success,
.text-danger,
.text-warning,
.text-info,
.text-muted {
    color: inherit !important;
}


/* ===========================================
   SIDEBAR LAYOUT (Admin & Shop Manager)
   Dynamic width based on viewport
   =========================================== */
.sidebar {
    min-height: 100vh;
    height: 100%;
    background: #1a1d21;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    /* Dynamic width: 20% on desktop, capped between 200px and 280px */
    width: clamp(200px, 20vw, 280px);
}

.sidebar .nav-link {
    color: #ffffff !important;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    background: #0d6efd;
    font-weight: 500;
    color: #fff !important;
}

/* Sidebar text should be white, not blue link color */
.sidebar a,
.sidebar a:hover,
.sidebar a:visited {
    color: #ffffff !important;
}

/* Sidebar separator styling */
.sidebar hr {
    border-color: rgba(255, 255, 255, 0.2);
    margin: 1rem 0;
}

.impersonation-panel {
    background: rgba(13, 110, 253, 0.12);
    border: 1px solid rgba(13, 110, 253, 0.35);
    border-radius: 8px;
    padding: 0.75rem;
}

.sidebar .impersonation-user-link,
.sidebar .impersonation-user-link:hover,
.sidebar .impersonation-user-link:visited {
    color: var(--link-color) !important;
    text-decoration: underline;
    max-width: 100%;
    overflow: hidden;
}

.sidebar .impersonation-user-link:hover {
    color: var(--link-hover-color) !important;
}

.impersonation-user-name {
    color: inherit;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

.impersonation-user-email {
    color: inherit;
    opacity: 0.9;
    font-size: 0.82rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

.impersonation-switch .form-check-input {
    cursor: pointer;
}

.impersonation-switch .form-check-label {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
}

.impersonation-actions .btn {
    width: 100%;
}

.shop-tutorial-card {
    padding: 0.85rem 0.95rem;
}

.shop-tutorial-text {
    min-width: 0;
}

.shop-tutorial-card h5 {
    font-size: 1rem;
    font-weight: 600;
}

.shop-tutorial-card .text-muted {
    color: inherit !important;
}

.tutorial-checklist {
    margin-bottom: 0;
}

.tutorial-checklist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.tutorial-checklist-item:last-child {
    margin-bottom: 0;
}

.tutorial-check-icon {
    width: 1rem;
    min-width: 1rem;
    height: 1rem;
    text-align: center;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
}

.tutorial-check-box {
    width: 0.82rem;
    height: 0.82rem;
    border: 2px solid #ffffff;
    border-radius: 2px;
    display: inline-block;
    box-sizing: border-box;
}

.tutorial-checklist-item.is-done .tutorial-check-icon {
    color: #198754;
}

.tutorial-checklist-item.is-pending .tutorial-check-icon {
    color: #ffffff;
}

.tutorial-checklist-item.is-disabled {
    margin-left: 1rem;
    opacity: 0.62;
}

.tutorial-step-link,
.tutorial-step-link:visited {
    color: var(--link-color) !important;
    text-decoration: underline;
    font-weight: 500;
}

.tutorial-step-link:hover,
.tutorial-step-link:focus {
    color: var(--link-hover-color) !important;
    text-decoration: underline;
}

.tutorial-step-disabled-label {
    color: #dce2e7;
    text-decoration: none;
    cursor: default;
    pointer-events: none;
}

.tutorial-step-text {
    color: #f8f9fa;
}

.tutorial-switches-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.45rem 0.8rem;
}

.tutorial-switch-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.4rem;
    padding: 0.4rem 0.5rem;
    background: rgba(255, 255, 255, 0.02);
}

.tutorial-switch-name {
    color: #f1f3f5;
    font-size: 0.86rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Desktop: Push content for sidebar with dynamic matching width */
@media (min-width: 769px) {
    body.has-sidebar,
    body.admin-body,
    body.shopmanager-body {
        margin-left: clamp(200px, 20vw, 280px);
    }

    .sidebar {
        width: clamp(200px, 20vw, 280px);
    }

    /* Hide mobile-only elements on desktop */
    .mobile-header,
    .sidebar-backdrop {
        display: none !important;
    }
}

/* Mobile: Collapsible sidebar overlay (Shop Manager only) */
@media (max-width: 768px) {
    body.shopmanager-body .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100dvh;
        width: 280px !important;
        z-index: 1100;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    body.shopmanager-body .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Don't push user/logout to bottom - flow after nav items */
    body.shopmanager-body .sidebar .nav.mb-auto {
        margin-bottom: 0 !important;
    }

    /* Non-shopmanager sidebars (admin) keep old stacking behavior */
    .sidebar {
        position: static;
        height: auto;
        width: 100% !important;
    }

    body.has-sidebar,
    body.admin-body,
    body.shopmanager-body {
        margin-left: 0 !important;
    }

    /* Mobile header bar - entire bar is tappable, fixed above everything */
    .mobile-header {
        display: flex;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: #1a1d21;
        height: 50px;
        padding: 0 1rem;
        border-bottom: 1px solid #2b3035;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.05);
        user-select: none;
        touch-action: manipulation;
    }

    .mobile-header:active {
        background: #22262b;
    }

    .mobile-header .mobile-hamburger {
        color: #ffffff;
        font-size: 1.5rem;
        line-height: 1;
        flex-shrink: 0;
    }

    .mobile-header .mobile-title {
        color: #ffffff;
        font-size: 1.1rem;
        font-weight: 500;
        margin-left: 0.75rem;
    }

    /* Sidebar close button (inside sidebar header) */
    .sidebar-close-btn {
        background: rgba(255, 255, 255, 0.08);
        border: none;
        color: #adb5bd;
        font-size: 1rem;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background 0.15s ease, color 0.15s ease;
        flex-shrink: 0;
    }

    .sidebar-close-btn:hover,
    .sidebar-close-btn:active {
        background: rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }

    /* Sidebar backdrop overlay */
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100dvh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1050;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .sidebar-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* Action toolbar - static and wrapping on mobile */
    .action-toolbar {
        position: static !important;
        top: auto !important;
        height: auto !important;
        min-height: unset !important;
        padding: 0.75rem 1rem !important;
        flex-wrap: wrap;
        gap: 0.5rem;
        z-index: auto !important;
    }

    .action-toolbar h4 {
        width: 100%;
        font-size: 1.1rem;
    }

    .action-toolbar .d-flex.gap-2 {
        flex-wrap: wrap;
        gap: 0.35rem !important;
    }

    .action-toolbar .btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
        min-height: unset !important;
    }

    /* Main content - padding-top accounts for fixed mobile header (50px) */
    .main-content {
        padding: 0.75rem !important;
        padding-top: 58px !important;
    }

    /* Game card header - stack title and controls */
    .card-header.d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }

    /* Controls row - wrap and reduce gap */
    .card-header .d-flex.align-items-center.gap-4 {
        flex-wrap: wrap;
        gap: 0.5rem !important;
        width: 100%;
    }

    /* Remove left borders on mobile (Highlight/Delete separators) */
    .game-highlight-control,
    .card-header .border-start {
        border-left: none !important;
        padding-left: 0 !important;
    }

    /* Game card body - stack columns */
    .card-body .col-md-auto {
        width: 100% !important;
        text-align: left !important;
    }

    /* Stat cards - smaller padding on mobile */
    .stat-card {
        padding: 12px 14px;
    }

    .stat-card h2 {
        font-size: 1.4rem;
    }

    /* Analytics button groups - allow wrapping */
    .card-header .btn-group {
        flex-wrap: wrap;
    }

    .card-header .d-flex.flex-wrap {
        gap: 0.35rem !important;
    }

    /* Dashboard store URLs card on mobile */
    .dashboard-store-urls {
        font-size: 0.85rem;
    }

    .dashboard-store-urls a {
        word-break: break-all;
    }
}


/* ===========================================
   ACTION TOOLBAR (Admin & Shop Manager)
   =========================================== */
.action-toolbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 60px;
    background: #1a1d21;
    border-bottom: 1px solid #2b3035;
    z-index: 900;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    justify-content: space-between;
}

@media (min-width: 769px) {
    .action-toolbar {
        left: 250px;
    }
}


/* ===========================================
   STAT CARDS (Admin & Shop Manager Dashboard)
   =========================================== */
.stat-card {
    background: #2c3034;
    border-radius: 8px;
    padding: 20px;
    border-left: 5px solid #0d6efd;
}

.stat-card.success {
    border-left-color: #198754;
}

.stat-card.warning {
    border-left-color: #ffc107;
}

.stat-card.info {
    border-left-color: #0dcaf0;
}


/* ===========================================
   VIEW MODE TOGGLE BUTTONS
   =========================================== */
.btn-view-mode,
.btn-analytics-nav {
    background-color: #6c757d !important;
    color: #ffffff !important;
    border: none !important;
    padding: 6px 16px;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-view-mode:hover,
.btn-analytics-nav:hover:not(:disabled) {
    background-color: #5c636a !important;
    color: #ffffff !important;
}

.btn-view-mode.active {
    background-color: var(--btn-primary-bg) !important;
    color: var(--btn-primary-text) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-analytics-nav:disabled {
    background-color: #2b3035 !important;
    color: #7a8288 !important;
    border: 1px solid #3a4046 !important;
    cursor: not-allowed;
    opacity: 1 !important;
    box-shadow: none !important;
}


/* ===========================================
   noUiSlider STYLING
   =========================================== */
.noUi-target {
    background: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    border-radius: 10px;
    box-shadow: none;
    height: 8px !important;
    margin: 8px auto 5px auto;
    padding: 0;
    width: 90%;
}

.noUi-connect {
    background: var(--btn-primary-bg, #0d6efd) !important;
    height: 11px !important;
    top: -1.5px;
}

.noUi-handle {
    background: #000000 !important;
    border: 2px solid var(--btn-primary-bg, #0d6efd) !important;
    border-radius: 50% !important;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5) !important;
    width: 24px !important;
    height: 24px !important;
    right: -12px !important;
    top: -8px !important;
    cursor: pointer;
}

.noUi-handle:before,
.noUi-handle:after {
    display: none !important;
}

#userSettingsModal .noUi-connect {
    height: calc(100% + 2px);
    top: -1px;
}


/* ===========================================
   ROTATED DISCOUNT BANNERS
   =========================================== */
.rotated-discount-banner,
.rotated-discount-banner-list {
    position: absolute;
    right: auto;
    background: var(--sale-badge-bg);
    color: var(--sale-badge-text);
    font-weight: bold;
    z-index: 1000;
    transform: rotate(-25deg);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.rotated-discount-banner {
    top: -15px;
    left: -15px;
    padding: 5px 10px;
    font-size: 1rem;
}

.rotated-discount-banner-list {
    top: -5px;
    left: -5px;
    padding: 2px 6px;
    font-size: 0.7rem;
}


/* ===========================================
   SALE BANNER
   =========================================== */
.sale-banner-container {
    padding: 0 15px;
    margin-bottom: 2rem;
}

.sale-banner {
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    max-height: 200px;
    overflow-y: auto;
    border: 2px solid rgba(255, 255, 255, 0.1);
}


/* ===========================================
   MODAL STYLING
   =========================================== */
.game-modal-title-link {
    color: var(--header-text) !important;
    text-decoration: none;
    font-weight: 700;
}

.game-modal-search-link {
    margin-left: 0.6rem;
    color: var(--link-color) !important;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 700;
    opacity: 0.95;
}

.game-modal-search-link:hover {
    color: var(--link-hover-color) !important;
    text-decoration: underline;
}

.game-modal-search-icon {
    font-size: 0.9rem;
    margin-right: 0.25rem;
    vertical-align: 0.03em;
}

.game-modal-content,
.game-modal-description,
.game-modal-list-item,
.game-modal-list-item b {
    color: var(--card-text) !important;
}

.modal {
    z-index: 2000;
    pointer-events: auto;
}

.modal-backdrop {
    z-index: 1990;
}

.modal-dialog {
    pointer-events: auto;
}

.tooltip {
    z-index: 2060;
}

.modal-add-btn {
    transition: all 0.2s ease;
    font-weight: bold !important;
}

.modal-body.p-0>.container-fluid {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}


/* ===========================================
   CARD LABELS & VALUES
   =========================================== */
.card-label {
    font-weight: 800 !important;
    text-transform: uppercase;
    font-size: 0.85rem !important;
    opacity: 0.8;
}

.card-value {
    font-weight: bold !important;
    font-size: 1.15rem !important;
}


/* ===========================================
   FLOATING CART UI
   =========================================== */
#floating-cart-anchor {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1030;
}

#cart-status-bubble {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

#cart-status-bubble .badge-count {
    background: #dc3545;
    color: white;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}


/* ===========================================
   CUSTOM COLUMN CLASSES (Grid Layout)
   =========================================== */
.row-cols-custom-1>* {
    flex: 0 0 100%;
    max-width: 100%;
}

.row-cols-custom-2>* {
    flex: 0 0 50%;
    max-width: 50%;
}

.row-cols-custom-3>* {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

.row-cols-custom-4>* {
    flex: 0 0 25%;
    max-width: 25%;
}

.row-cols-custom-5>* {
    flex: 0 0 20%;
    max-width: 20%;
}

.row-cols-custom-6>* {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
}

.row-cols-custom-7>* {
    flex: 0 0 14.285714%;
    max-width: 14.285714%;
}

.row-cols-custom-8>* {
    flex: 0 0 12.5%;
    max-width: 12.5%;
}

.row-cols-custom-9>* {
    flex: 0 0 11.111111%;
    max-width: 11.111111%;
}

.row-cols-custom-10>* {
    flex: 0 0 10%;
    max-width: 10%;
}

.row-cols-custom-11>* {
    flex: 0 0 9.090909%;
    max-width: 9.090909%;
}

.row-cols-custom-12>* {
    flex: 0 0 8.333333%;
    max-width: 8.333333%;
}


/* ===========================================
   THUMBNAIL VIEW CARD STYLING
   =========================================== */
.thumb-card .card-title {
    cursor: pointer;
    font-size: 0.95rem !important;
    font-weight: bold !important;
    white-space: normal;
    color: var(--card-text) !important;
    line-height: 1.2;
    margin-bottom: 0 !important;
}

.thumb-card .btn {
    flex-shrink: 0;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.btn-xs {
    padding: 1px 6px;
    font-size: 0.7rem;
}


/* ===========================================
   DETAILS TABLE (Modal)
   =========================================== */
.details-table {
    width: 100%;
    margin-bottom: 1rem;
    background: transparent;
    border-collapse: collapse;
}

.details-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--card-text);
}

.details-table td:first-child {
    width: 140px;
    background: rgba(255, 255, 255, 0.05);
}


/* ===========================================
   SHOP TABLE (List View)
   =========================================== */
.shop-table {
    border-color: rgba(255, 255, 255, 0.2) !important;
    border-collapse: collapse !important;
    border-spacing: 0;
    table-layout: fixed;
}

.shop-table tr.stripe-even {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

.shop-table tr.stripe-odd {
    background-color: transparent !important;
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
    background-color: transparent !important;
    box-shadow: none !important;
}

.shop-table td {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    overflow: visible !important;
    word-wrap: break-word;
}

.table-bordered> :not(caption)>*>* {
    border-width: 1px;
}

.shop-table td .text-muted,
.shop-table td .small.text-muted,
.shop-table .list-group-item .text-muted {
    color: rgba(255, 255, 255, 0.95) !important;
}


/* ===========================================
   INQUIRY FORM
   =========================================== */
#inquiry-form .form-label {
    color: #fff;
}

#inquiry-form .form-control {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

#inquiry-form .form-control:focus {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: var(--btn-primary-bg);
    box-shadow: none;
    color: #ffffff;
}

#inquiry-form ::placeholder {
    color: transparent;
}


/* ===========================================
   GAME DETAILS STYLING
   =========================================== */
.game-details-hr {
    margin: 0.25rem 0 !important;
    opacity: 0.1;
}

.game-details-section p,
.game-details-section dl {
    margin-bottom: 0.5rem !important;
}

.game-details-section dt {
    font-size: 0.95em;
}

#game-gallery .list-group-item {
    border: none !important;
    position: relative;
}

#game-gallery .list-group-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10px;
    right: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#game-gallery .list-group-item:last-child::after {
    display: none;
}


/* ===========================================
   TAGS WRAPPER (Collapsible)
   =========================================== */
#tags-wrapper {
    max-height: 75px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.4s ease-in-out;
}

#tags-wrapper.expanded {
    max-height: 1000px;
    transition: max-height 0.6s ease-in-out;
}

#tags-wrapper:not(.expanded)::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--card-background));
    pointer-events: none;
}

/* Tag button and outline-light active/hover states - blue highlight */
.tag-btn.btn:hover,
.tag-btn.btn:active,
.tag-btn.btn:focus,
.tag-btn.btn.active,
.tag-btn.btn.active:focus,
.tag-btn.btn.active:active,
.btn-outline-light:hover,
.btn-outline-light:active,
.btn-outline-light.active {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

.tag-btn.btn.active:hover,
.btn-outline-light.active:hover {
    background-color: #0b5ed7 !important;
    border-color: #0b5ed7 !important;
    color: #ffffff !important;
}

/* Tag action links hover state */
#tags-toggle-btn:hover,
#clear-tags-btn:hover {
    opacity: 0.8;
    text-decoration: underline !important;
}


/* ===========================================
   LIST VIEW ITEM (Hybrid Card)
   =========================================== */
.list-view-item {
    background-color: var(--card-background);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px;
    position: relative;
    padding: 0;
    min-height: 140px;
    margin-bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.list-header {
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 5px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    position: relative;
}

.list-view-item .list-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--header-text);
    line-height: 1.2;
    margin: 0;
    padding: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-align: left;
}

.list-view-item .list-price {
    position: static !important;
    width: auto !important;
    min-width: fit-content;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--price-text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 10px;
}

.list-view-item .list-header-actions {
    width: 140px;
    flex-shrink: 0;
    text-align: right;
}

.list-view-item .list-header-actions .btn {
    width: 100% !important;
    padding-top: 4px;
    padding-bottom: 4px;
}

.list-body {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
}

.list-view-item .list-img {
    position: relative !important;
    width: 60px !important;
    height: 60px !important;
    padding: 0 !important;
    flex-shrink: 0;
}

.list-view-item .list-details-container {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.list-view-item .list-details {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
    margin-bottom: 2px;
}

.list-view-item .list-actions {
    display: none !important;
}


/* ===========================================
   SETTINGS BUTTON
   =========================================== */
#settings-btn {
    transition: transform 0.3s ease;
    color: var(--header-text) !important;
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
    background: transparent !important;
    padding: 4px !important;
    z-index: 50;
}

#filter-controls-placeholder label {
    color: #ffffff !important;
    margin-bottom: 4px;
    font-size: 1.15rem !important;
    opacity: 1;
}


/* ===========================================
   PICKR COLOR PICKER (Shop Manager)
   =========================================== */
.pickr {
    border-radius: 50px;
    background: transparent !important;
}

.pickr .pcr-button {
    width: 100%;
    height: 38px;
    border-radius: 0.25rem !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
}

.pickr-container.pickr-square {
    width: 18px;
    height: 18px;
    min-width: 18px;
    max-width: 18px;
    flex: 0 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pickr-container.pickr-square .pickr {
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    flex: 0 0 18px;
    display: block;
    line-height: 0;
}

.pickr-container.pickr-square .pickr .pcr-button {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    border-radius: 0.25rem !important;
    border-width: 1px !important;
    box-sizing: border-box !important;
    display: block !important;
    padding: 0 !important;
}

.game-highlight-control {
    gap: 0.45rem;
}

.game-highlight-swatch.pickr-square {
    margin-left: 0.1rem;
}

.pcr-app {
    background: #2b3035 !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

.pcr-interaction input {
    background: #212529 !important;
    color: #fff !important;
    border-color: #495057 !important;
}

.pcr-interaction input:focus {
    border-color: #0d6efd !important;
    box-shadow: none !important;
}

.pcr-swatches button {
    border: 1px solid rgba(255, 255, 255, 0.2);
}


/* ===========================================
   CUSTOM COLOR GRID (Shop Manager)
   =========================================== */
.custom-color-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .custom-color-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .custom-color-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ===========================================
   GAME TITLE LINKS (Shop Manager)
   =========================================== */
.game-title-link {
    color: var(--link-color);
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 500;
}

.game-title-link:hover {
    text-decoration: underline;
}

.bgg-search-link {
    color: var(--link-color);
    opacity: 0.8;
    text-decoration: none;
    font-size: 0.9rem;
    margin-left: 8px;
}

.bgg-search-link:hover {
    text-decoration: underline;
    opacity: 1;
}


/* ===========================================
   IMAGE THUMBNAIL WRAPPER (Shop Manager)
   =========================================== */
.thumb-wrapper {
    position: relative;
    display: inline-block;
}

.remove-image-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    line-height: 1;
}

.opt-label {
    font-size: 0.85rem;
    color: #ffffff;
    cursor: pointer;
}


/* ===========================================
   HIDE NUMBER SPIN BUTTONS
   =========================================== */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}


/* ===========================================
   MOBILE OPTIMIZATIONS
   =========================================== */
@media (max-width: 768px) {

    /* Hide Original Price in ALL Views on Mobile */
    .original-price {
        display: none !important;
    }

    /* Full Page Width & Minimal Padding */
    .container,
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Rotated banner in list view */
    .rotated-discount-banner-list {
        font-size: 0.6rem;
        padding: 1px 4px;
        left: -5px;
        top: -5px;
    }

    #controls:not(.mobile-filters-expanded) .mobile-advanced-filter-block,
    #controls:not(.mobile-filters-expanded) #filter-controls-placeholder,
    #controls:not(.mobile-filters-expanded) #tag-container-placeholder,
    #controls:not(.mobile-filters-expanded) #tag-actions-row {
        display: none !important;
    }

    #mobile-filters-fold-row {
        position: relative;
        display: flex;
        align-items: flex-end;
        justify-content: center;
        text-align: center;
        margin: 0 -1rem -1rem;
        padding: 1.25rem 0 0.1rem;
        border-bottom-left-radius: 0.375rem;
        border-bottom-right-radius: 0.375rem;
    }

    #controls:not(.mobile-filters-expanded) #mobile-filters-fold-row {
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.12));
    }

    #home-search-card:not(.mobile-filters-expanded) #mobile-filters-fold-row {
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.12));
    }

    #controls.mobile-filters-expanded #mobile-filters-fold-row {
        background: transparent;
    }

    #home-search-card.mobile-filters-expanded #mobile-filters-fold-row {
        background: transparent;
    }

    #mobile-filters-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.8rem;
        height: 1.8rem;
        position: relative;
        z-index: 2;
        color: #ffffff !important;
        font-weight: 700;
        text-decoration: none;
    }

    #mobile-filters-toggle i {
        font-size: 1.25rem;
        line-height: 1;
    }

    #mobile-filters-toggle:hover {
        opacity: 0.9;
    }

    .shop-configure-link-text {
        font-size: 0.78rem;
    }
}


/* ===========================================
   MESSAGES PAGE STYLING
   =========================================== */

/* Message text box and contact details - inner card appearance */
.message-content-box,
.contact-details-card {
    background-color: var(--card-bg, #2b3035) !important;
}

.message-content-box {
    border-radius: 0.375rem;
    padding: 1rem;
}

/* Game items in messages - zebra striping */
.message-game-item:nth-child(odd) {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.message-game-item:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02) !important;
}


/* Contact threads chat layout */
.contact-thread-message {
    display: flex;
    width: 100%;
}

.contact-thread-message-admin {
    justify-content: flex-end;
}

.contact-thread-message-user {
    justify-content: flex-start;
}

.contact-thread-bubble {
    background-color: #2b3035;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 14px;
    max-width: 70%;
}

.contact-thread-message-user .contact-thread-bubble {
    background-color: #233044;
    border-color: rgba(88, 166, 255, 0.3);
}

.contact-thread-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.contact-thread-sender {
    font-weight: 700;
    color: #ffffff;
}

.contact-thread-body {
    color: #ffffff;
    line-height: 1.5;
}

.collapsed-summary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 10px 12px;
    color: #e9ecef;
    font-size: 0.9rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.collapsed-summary .collapsed-text {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collapsed-summary .summary-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex: 0 0 auto;
}

.collapsed-summary .collapse-toggle {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: #e9ecef;
    min-height: 24px !important;
    min-width: 24px;
    border-radius: 4px;
    padding: 0 !important;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.collapsed-summary .collapse-toggle:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

.card.is-collapsed .card-body > :not(.collapsed-summary) {
    display: none !important;
}

.collapsed-summary .collapsed-title {
    font-weight: 700;
    color: #ffffff;
}

.collapsed-summary .collapsed-sep {
    opacity: 0.75;
}

.collapsed-summary .collapsed-pill {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    color: #dbe9ff;
    background: rgba(13, 110, 253, 0.18);
    border: 1px solid rgba(13, 110, 253, 0.35);
}

.collapsed-summary .collapsed-note {
    margin-left: 10px;
    opacity: 0.92;
    color: #ced4da;
}

/* Slightly tighter message cards */
[id^="msg-"] .card-body,
[id^="contact-"] .card-body,
.admin-messages-section .card > .card-body {
    padding: 0.85rem;
}

/* Reduce padding when collapsed */
.card.is-collapsed > .card-body {
    padding: 0.5rem !important;
}

.collapsed-summary:hover {
    background: rgba(88, 166, 255, 0.12);
    border-color: rgba(88, 166, 255, 0.45);
}

.card.is-finished {
    background: rgba(25, 135, 84, 0.14);
    border-color: rgba(25, 135, 84, 0.45);
}

.card.is-finished .collapsed-summary {
    background: rgba(25, 135, 84, 0.22);
    border-color: rgba(25, 135, 84, 0.5);
}

.card.is-finished .collapsed-summary:hover {
    background: rgba(25, 135, 84, 0.28);
    border-color: rgba(25, 135, 84, 0.58);
}

.admin-messages-section.admin-messages-open {
    background: rgba(44, 48, 52, 0.65);
}

.admin-messages-section.admin-messages-completed {
    background: rgba(33, 37, 41, 0.75);
}

/* Admin users table layout and corner fix */
.admin-users-card .card-body {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    overflow: hidden;
}

.admin-users-table {
    font-size: 0.93rem;
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.admin-users-table .badge {
    font-size: 0.72rem;
}

.admin-users-table th.admin-users-col-select,
.admin-users-table td.admin-users-col-select {
    width: 20px;
    min-width: 20px;
    max-width: 20px;
    padding-left: 0.125rem;
    padding-right: 0.125rem;
    text-align: center;
    white-space: nowrap;
}

.admin-users-col-email {
    width: 18%;
}

.admin-users-col-bgg {
    width: 12%;
}

.admin-users-col-store {
    width: 14%;
}

.admin-users-col-perks,
.admin-users-col-promo {
    width: 15.5%;
}

.admin-users-col-subscription {
    width: 10%;
}

.admin-users-col-registered {
    width: 8%;
}

.admin-users-col-actions {
    width: 7%;
}

.admin-users-col-select .form-check-input {
    margin: 0;
}

.admin-users-date-input {
    max-width: 130px;
}

.admin-users-date-end {
    display: none;
}

.admin-users-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.admin-users-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

/* Perks table corner fix */
.admin-perks-card .card-body {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    overflow: hidden;
}

.admin-perks-table,
.perk-cap-table {
    border-collapse: separate;
    border-spacing: 0;
}

.admin-perks-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.admin-perks-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.perk-cap-btn {
    width: 72px;
    min-width: 72px;
    text-align: center;
}

.admin-perk-color-picker,
.promo-color-picker {
    width: 100%;
}

.admin-perk-color-picker .pickr,
.promo-color-picker .pickr {
    width: 100%;
    display: block;
}

.promo-color-picker .pickr .pcr-button {
    width: 100% !important;
}

.perk-cap-table {
    overflow: hidden;
    border-radius: 10px;
}

.perk-cap-table thead tr th:first-child {
    border-top-left-radius: 10px;
}

.perk-cap-table thead tr th:last-child {
    border-top-right-radius: 10px;
}

.perk-cap-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 10px;
}

.perk-cap-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 10px;
}

.perk-cap-block {
    width: 100%;
    margin: 0;
}

.admin-logs-page .admin-log-filter-btn {
    min-width: 92px;
    border-width: 1px;
    font-weight: 600;
}

.admin-logs-page .admin-log-filter-warning {
    background: #f1c40f !important;
    border-color: #f1c40f !important;
    color: #1f2124 !important;
}

.admin-logs-page .admin-log-filter-error {
    background: #fd7e14 !important;
    border-color: #fd7e14 !important;
    color: #ffffff !important;
}

.admin-logs-page .admin-log-filter-critical {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
}

.admin-logs-page .admin-log-filter-btn-off {
    opacity: 0.5;
}

.admin-logs-table thead th {
    font-size: 0.78rem;
    font-weight: 500;
}

.admin-logs-table tbody td {
    font-size: 0.81rem;
    vertical-align: top;
}

.admin-logs-table .log-level-dot {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #6c757d;
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.admin-logs-table .log-level-dot-error {
    background: #fd7e14;
}

.admin-logs-table .log-level-dot-critical {
    background: #dc3545;
}

.admin-logs-table .log-level-dot-warning {
    background: #f1c40f;
}

.admin-logs-table .log-level-dot-info {
    background: #0dcaf0;
}

.admin-logs-table .admin-log-message {
    font-weight: 400;
}

.admin-logs-table .admin-log-info-line {
    margin-bottom: 0.25rem;
}

.admin-logs-table .admin-log-info-line:last-child {
    margin-bottom: 0;
}

.admin-logs-table .admin-log-info-label {
    color: #adb5bd;
}

.admin-logs-table .admin-log-context-wrap {
    max-height: 260px;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: #11161b;
    padding: 8px 10px;
}

.admin-logs-table .admin-log-context {
    font-size: 0.72rem;
    line-height: 1.32;
    color: #d9e1e8;
    white-space: pre-wrap;
    word-break: break-word;
}

.admin-logs-table .admin-log-action-btn {
    width: 100%;
    white-space: nowrap;
}


/* ===========================================
   BUTTON SIZE CONSISTENCY
   =========================================== */

/* Ensure btn-sm has consistent minimum height */
.btn-sm {
    min-height: 32px !important;
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

/* Ensure all button variants in action toolbar and cards have same height */
.action-toolbar .btn,
.card-body .btn:not(.thumb-cart-btn) {
    min-height: 38px;
}


/* ===========================================
   PICKR COLOR PICKER CUSTOMIZATION
   =========================================== */

/* Make save button green */
.pcr-app .pcr-interaction .pcr-save {
    background-color: #198754 !important;
    color: #ffffff !important;
}

.pcr-app .pcr-interaction .pcr-save:hover {
    background-color: #157347 !important;
}

/* Rounded corners for all pcr-app interactive elements */
.pcr-app .pcr-interaction button,
.pcr-app .pcr-selection .pcr-color-preview,
.pcr-app .pcr-interaction input {
    border-radius: 6px !important;
}

/* Hide HEXA format button */
.pcr-app .pcr-interaction .pcr-type.active[data-type="HEXA"] {
    display: none !important;
}

/* Hide the entire type switcher if only one format is available */
.pcr-app .pcr-interaction .pcr-type {
    display: none !important;
}


/* ===========================================
   EULA MODAL STYLING OVERRIDE
   Prevent inline styles from creating unreadable boxes
   =========================================== */
#termsModal .alert-info {
    background-color: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: var(--card-text) !important;
}


/* ===========================================
   HOME PAGE STYLES
   =========================================== */

.hero-section {
    position: relative;
    padding: 40px 0 20px 0;
    overflow: hidden;
}

.shop-header-title {
    text-decoration: none;
    color: inherit;
    margin: 1rem 0 0.45rem;
}

.shop-title-main {
    vertical-align: middle;
    font-weight: 600;
    line-height: 1.05;
}

.shop-header-inline-flag {
    width: 28px;
    height: 20px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.shop-header-inline-trades {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    color: var(--header-text);
    gap: 0.25rem;
    font-size: 0.88rem;
    line-height: 1.1;
}

.shop-header-trades-on {
    color: #9fffb3;
}

.shop-header-trades-off {
    color: rgba(255, 255, 255, 0.65);
}

.shop-subtitle {
    margin-top: 0.15rem;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0.95;
    line-height: 1.15;
}

.shop-regionality-row {
    margin-top: 0.35rem;
    font-size: 1rem;
    opacity: 0.93;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.shop-regionality-text {
    line-height: 1.1;
}

.shop-regionality-trade {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    line-height: 1.1;
}

.shop-header-inline-trades-text {
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}

.shop-configure-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.35rem;
    font-size: 0.9rem;
    color: var(--link-color);
    text-decoration: none;
    vertical-align: middle;
}

.shop-configure-link:hover {
    color: var(--link-hover-color);
}

.shop-configure-link-text {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.shop-header-icon {
    height: 60px;
    vertical-align: middle;
    margin-right: 10px;
    padding-left: 5px;
}

@media (max-width: 991.98px) {
    .shop-subtitle {
        font-size: 1.05rem;
    }

    .shop-regionality-row {
        font-size: 0.95rem;
    }
}

/* Prevent underline artifacts on icon-only home link inside the store title. */
a.shop-home-link:not(.btn):not(.nav-link),
a.shop-home-link:not(.btn):not(.nav-link):hover,
a.shop-home-link:not(.btn):not(.nav-link):focus,
a.shop-home-link:not(.btn):not(.nav-link):active,
a.shop-home-link:not(.btn):not(.nav-link):visited {
    text-decoration: none !important;
}


.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 50% 30%, rgba(88, 166, 255, 0.12) 0%, transparent 70%);
}

.hero-section .hero-banner {
    max-width: 600px;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.home-hero-title {
    font-size: 1.75rem;
}

.home-hero-subtitle {
    max-width: 700px;
    font-size: 1rem;
}

.home-arrow-icon {
    color: #58A6FF;
}

.concept-section,
.search-section {
    padding: 20px 0 30px 0;
}

.search-card {
    background: rgba(45, 55, 72, 0.6);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

.before-after-img {
    border-radius: 12px;
    border: 2px solid rgba(88, 166, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    width: 100%;
    height: auto;
    background: #1a1d29;
    min-height: 200px;
}

.before-after-img:hover {
    border-color: rgba(88, 166, 255, 0.6);
    transform: scale(1.02);
}

/* Game cards in search results */
.game-card {
    background: #343a40;
    border-radius: 8px;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.game-card:hover {
    border-color: rgba(88, 166, 255, 0.4);
}

.game-card-img-wrapper {
    position: relative;
    aspect-ratio: 1/1;
    overflow: visible;
    background: #1a1d29;
}

.game-card-clickable {
    cursor: pointer;
}

.country-flag-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 48px;
    height: 36px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.language-flag-overlay {
    position: absolute;
    bottom: -6px;
    right: -6px;
    top: auto;
    left: auto;
    width: 48px;
    height: 36px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.4);
    z-index: 50;
}

.thumb-card .language-flag-overlay {
    width: 34px;
    height: 25px;
}

.language-flag-inline,
.store-flag-inline {
    width: 28px;
    height: 20px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.list-img .language-flag-overlay {
    width: 28px;
    height: 20px;
    bottom: -4px;
    right: -4px;
}

.sale-badge-card {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #dc3545;
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.store-name-bar {
    background: #343a40;
    padding: 6px 12px;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.store-name-text {
    flex: 1 1 auto;
    min-width: 0;
}


.store-name-bar a {
    color: #f8f9fa !important;
    text-decoration: none;
}

.store-name-bar a:hover {
    color: #58A6FF !important;
}

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

.game-card-bgg-link {
    color: var(--link-color) !important;
}

.game-card-list {
    background: transparent !important;
}

.game-card-price {
    font-size: 1.1rem;
}

/* Shared price colors — font-size set per context below */
.game-card-price-sale,
.search-modal-price-sale {
    color: #dc3545;
    font-weight: 800;
}

.game-card-price-old,
.search-modal-price-old {
    color: rgba(255, 255, 255, 0.6);
}

.game-card-price-regular,
.search-modal-price-regular {
    color: #c8fbfd;
    font-weight: 800;
}

/* Search modal prices are larger */
.search-modal-price-sale,
.search-modal-price-regular {
    font-size: 1.75rem;
}

.search-modal-price-old {
    text-decoration: line-through;
}

.game-card-note-line {
    line-height: 1.2;
}

/* Store cards in directory */
.store-card {
    background: rgba(52, 58, 64, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    max-width: 240px;
    margin: 0 auto;
}

.store-card-promoted {
    border-width: 2px;
    border-color: var(--store-promo-color, #ffc107);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--store-promo-color, #ffc107) 45%, transparent), 0 0 12px color-mix(in srgb, var(--store-promo-color, #ffc107) 50%, transparent);
}

.store-thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
    margin-bottom: 8px;
}

.store-thumbnail {
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: 4px;
    background: #1a1d29;
}

.store-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-cart-btn {
    width: 100% !important;
    min-height: 32px !important;
    padding: 0.3rem 0.65rem !important;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.thumb-cart-btn .thumb-cart-label {
    font-weight: 600;
}

.store-card-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #f8f9fa;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-card-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
}

.store-flag {
    width: 16px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
}

.country-badge {
    background: rgba(88, 166, 255, 0.15);
    border: 1px solid rgba(88, 166, 255, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* BGG Footer */
.bgg-footer-logo {
    height: 40px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.bgg-footer-logo:hover {
    opacity: 1;
}

/* Search modal */
.search-game-modal-header {
    padding: 1rem 1.5rem;
}

.search-modal-title-link {
    text-decoration: none;
    color: var(--card-text) !important;
    font-weight: 700;
}

.search-modal-title-link:hover {
    text-decoration: underline;
}

.search-modal-media {
    background: rgba(0, 0, 0, 0.15);
}

.search-modal-image {
    width: 100%;
    max-width: 300px;
}

.search-modal-link {
    color: var(--link-color) !important;
}

.search-modal-price {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.search-modal-description {
    color: rgba(255, 255, 255, 0.75);
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.search-modal-extras-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.search-modal-extras-body {
    font-size: 0.9rem;
    opacity: 0.8;
}

.search-modal-meta .list-group-item + .list-group-item {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#home-search-card:not(.mobile-filters-expanded) .home-search-advanced-block {
    display: none;
}

#home-search-card #mobile-filters-fold-row {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
    margin: 0 -1rem -1rem;
    padding: 1.25rem 0 0.1rem;
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

#home-search-card:not(.mobile-filters-expanded) #mobile-filters-fold-row {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.12));
}

#home-search-card.mobile-filters-expanded #mobile-filters-fold-row {
    background: transparent;
}

#home-search-card #mobile-filters-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    position: relative;
    z-index: 2;
    color: #ffffff !important;
    font-weight: 700;
    text-decoration: none;
}

#home-search-card #mobile-filters-toggle i {
    font-size: 1.25rem;
    line-height: 1;
}

.home-page {
    background: linear-gradient(180deg, #1a1d29 0%, #1e1a2e 30%, #1a1d29 60%, #1e1a2e 100%);
    min-height: 100vh;
    position: relative;
}

.store-page-wrap {
    background-image:
        linear-gradient(180deg,
            color-mix(in srgb, var(--store-gradient-top) 40%, var(--store-gradient-overlay-color) 60%) 0%,
            color-mix(in srgb, var(--store-gradient-mid) 40%, var(--store-gradient-overlay-color) 60%) 30%,
            color-mix(in srgb, var(--store-gradient-bottom) 40%, var(--store-gradient-overlay-color) 60%) 60%,
            color-mix(in srgb, var(--store-gradient-mid) 40%, var(--store-gradient-overlay-color) 60%) 100%
        );
    min-height: 100vh;
    position: relative;
}

body.store-page::before,
body.store-page::after,
body.home-body::before,
body.home-body::after {
    display: none !important;
}

@media (min-width: 1200px) {
    .store-page-wrap::before,
    .store-page-wrap::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 4px;
        background-image:
            linear-gradient(to bottom,
                transparent,
                color-mix(in srgb, var(--store-stripe-overlay-color) 70%, transparent),
                color-mix(in srgb, var(--store-stripe-overlay-color) 24%, transparent),
                color-mix(in srgb, var(--store-stripe-overlay-color) 70%, transparent),
                transparent
            );
        background-size: 100% var(--store-stripe-segment);
        background-repeat: repeat-y;
        background-position: top;
        z-index: 1;
        pointer-events: none;
    }

    .store-page-wrap::before {
        left: 0;
    }

    .store-page-wrap::after {
        right: 0;
    }
}

/* IMPORTANT: Do not apply z-index to modals.
   Wrapping content gets z-index for gradients, but modals must sit above overlays. */
.store-page-wrap > :not(.modal),
.home-page > :not(.modal) {
    position: relative;
    z-index: 2;
}

.store-page-wrap .modal,
.home-page .modal {
    z-index: 2000;
}

@media (min-width: 1200px) {
    .home-page::before,
    .home-page::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 4px;
        background: linear-gradient(to bottom, transparent, rgba(88, 166, 255, 0.4), rgba(88, 166, 255, 0.1), rgba(88, 166, 255, 0.4), transparent);
        z-index: 1;
        pointer-events: none;
    }

    .home-page::before {
        left: 0;
    }

    .home-page::after {
        right: 0;
    }
}

