﻿/* =========================================================
   GLOBAL GAMING THEME TOKENS
========================================================= */
:root {
    /* Background layers */
    --bg: #08131c;
    --bg-soft: #0d1c28;
    --bg-deep: #050c13;
    --bg-elevated: #142a3d;
    /* Surface / Panel layers */
    --panel: rgba(18, 36, 52, 0.94);
    --panel-soft: rgba(23, 42, 58, 0.78);
    --panel-strong: #183347;
    --panel-hover: rgba(28, 52, 72, 0.98);
    /* Borders / separators */
    --line: rgba(116, 216, 255, 0.22);
    --line-soft: rgba(116, 216, 255, 0.12);
    --line-strong: rgba(116, 216, 255, 0.46);
    /* Text */
    --text: #f2fbff;
    --text-soft: #ddf1fb;
    --muted: #abc4d0;
    --muted-2: #8faab7;
    /* Brand */
    --cyan: #74d8ff;
    --cyan-strong: #2fd8ff;
    --teal: #39efd3;
    --blue-glow: rgba(47, 216, 255, 0.26);
    --green-glow: rgba(57, 239, 211, 0.18);
    /* Status */
    --success: #49f0c2;
    --success-bg: rgba(73, 240, 194, 0.16);
    --success-line: rgba(73, 240, 194, 0.36);
    --warning: #ffd86e;
    --warning-bg: rgba(255, 216, 110, 0.16);
    --warning-line: rgba(255, 216, 110, 0.36);
    --danger: #ff819b;
    --danger-bg: rgba(255, 129, 155, 0.16);
    --danger-line: rgba(255, 129, 155, 0.36);
    --info: #74d8ff;
    --info-bg: rgba(116, 216, 255, 0.16);
    --info-line: rgba(116, 216, 255, 0.34);
    --neutral: #b2c5cf;
    --neutral-bg: rgba(178, 197, 207, 0.13);
    --neutral-line: rgba(178, 197, 207, 0.24);
    /* Shadows */
    --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 16px 38px rgba(0, 0, 0, 0.30);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.46);
    --shadow-glow: 0 0 0 1px rgba(116, 216, 255, 0.08), 0 12px 30px rgba(0, 0, 0, 0.22);
    /* Radius */
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
    /* Layout */
    --max-width: 1240px;
    /* Buttons */
    --btn-primary-text: #05131b;
    --btn-secondary-text: var(--text);
    /* Inputs */
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(116, 216, 255, 0.22);
    --input-border-focus: rgba(47, 216, 255, 0.54);
    --input-placeholder: #89a8b8;
    /* Table */
    --table-row: rgba(255, 255, 255, 0.03);
    --table-head: rgba(47, 216, 255, 0.13);
    /* Overlay */
    --overlay: rgba(4, 10, 16, 0.78);
}

/* =========================================================
   GLOBAL BASE
========================================================= */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body,
.theme-body {
    min-height: 100vh;
    color: var(--text);
    background: radial-gradient(circle at top right, rgba(47, 216, 255, 0.11), transparent 22%), radial-gradient(circle at left center, rgba(57, 239, 211, 0.08), transparent 20%), linear-gradient(180deg, #040b11 0%, #08131c 42%, #0b1823 100%);
}

a {
    color: var(--cyan);
    transition: color .2s ease, opacity .2s ease;
}

    a:hover {
        color: var(--cyan-strong);
    }

.text-muted,
small,
.muted {
    color: var(--muted) !important;
}

/* =========================================================
   LAYOUT / CONTAINER
========================================================= */
.app-container,
.theme-container,
.container-soft {
    width: min(calc(100% - 32px), var(--max-width));
    margin: 0 auto;
}

/* =========================================================
   NAVBAR / TOPBAR / FOOTER
========================================================= */
.theme-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(14px);
}

.theme-topbar,
.navbar.theme-navbar {
    background: rgba(8, 19, 28, 0.84);
    border-bottom: 1px solid var(--line-soft);
    backdrop-filter: blur(14px);
}

.theme-navbar {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    min-height: 64px;
    padding: 10px 0;
}

.theme-topbar a,
.navbar.theme-navbar .nav-link,
.navbar.theme-navbar .navbar-brand {
    color: var(--text);
}

    .theme-topbar a:hover,
    .navbar.theme-navbar .nav-link:hover,
    .theme-navbar .navbar-brand:hover {
        color: var(--cyan) !important;
    }

.theme-navbar .navbar-brand,
.theme-navbar .nav-link {
    color: var(--text) !important;
    transition: .2s ease;
}

.theme-navbar .container-fluid {
    gap: 14px;
}

.theme-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 0;
    letter-spacing: .02em;
    white-space: nowrap;
}

.theme-brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(73,240,194,0.32);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(47,216,255,0.22), rgba(73,240,194,0.12));
    color: #dffdf4;
    font-size: .78rem;
    font-weight: 900;
    box-shadow: 0 0 18px rgba(47,216,255,0.12);
}

.theme-main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.theme-main-nav .theme-nav-link,
.theme-user-nav .theme-nav-link,
.theme-logout-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 8px 12px !important;
    color: var(--text-soft) !important;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.theme-main-nav .theme-nav-link:hover,
.theme-main-nav .theme-nav-link:focus,
.theme-user-nav .theme-nav-link:hover,
.theme-logout-link:hover {
    border-color: rgba(116,216,255,0.22);
    background: rgba(116,216,255,0.08);
    color: var(--cyan) !important;
}

.theme-main-nav .theme-nav-link.active {
    border-color: rgba(73,240,194,0.28);
    background: rgba(73,240,194,0.10);
    color: #dffdf4 !important;
}

.theme-user-nav {
    flex: 0 0 auto;
}

.theme-user-greeting {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-soft) !important;
    font-weight: 800;
}

.theme-logout-link {
    color: #f2fbff !important;
}

.theme-navbar .navbar-toggler {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    box-shadow: none;
}

    .theme-navbar .navbar-toggler:focus {
        box-shadow: 0 0 0 4px rgba(47, 216, 255, 0.14);
    }

.theme-navbar .navbar-toggler-icon {
    filter: invert(1) opacity(.85);
}

.theme-footer {
    padding: 18px 0 28px;
    border-top: 1px solid var(--line-soft);
    background: rgba(8, 19, 28, 0.38);
    backdrop-filter: blur(10px);
}

/* =========================================================
   SURFACE / CARD / PANEL
========================================================= */
.theme-card,
.theme-panel,
.card-soft,
.glass-card {
    background: linear-gradient(180deg, rgba(20, 39, 56, 0.98), rgba(12, 24, 35, 0.95));
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    color: var(--text);
}

.theme-card-soft {
    background: linear-gradient(180deg, rgba(25, 46, 64, 0.76), rgba(18, 33, 46, 0.72));
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    color: var(--text);
    box-shadow: var(--shadow-glow);
}

.theme-floating {
    background: rgba(10, 22, 32, 0.86);
    border: 1px solid rgba(116, 216, 255, 0.22);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    border-radius: var(--radius-md);
}

/* =========================================================
   TYPOGRAPHY
========================================================= */
h1, h2, h3, h4, h5, h6 {
    color: var(--text);
}

.section-kicker,
.theme-kicker {
    color: var(--cyan);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.section-title,
.theme-title {
    color: var(--text);
    font-weight: 900;
    line-height: 1.1;
}

.section-desc,
.theme-desc {
    color: var(--muted);
    line-height: 1.8;
}

.display-5 {
    letter-spacing: -0.04em;
}

/* =========================================================
   BUTTONS
========================================================= */
.btn-theme-primary,
.theme-btn-primary,
.btn-primary {
    color: var(--btn-primary-text);
    background: linear-gradient(135deg, var(--cyan-strong), var(--teal));
    border: 1px solid transparent;
    border-radius: 999px;
    box-shadow: 0 18px 34px rgba(47, 216, 255, 0.24);
    font-weight: 800;
}

    .btn-theme-primary:hover,
    .theme-btn-primary:hover,
    .btn-primary:hover {
        color: var(--btn-primary-text);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        border-color: rgba(116, 216, 255, 0.48);
        filter: brightness(1.03);
    }

.btn-theme-secondary,
.theme-btn-secondary,
.btn-outline-secondary {
    color: var(--btn-secondary-text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(116, 216, 255, 0.24);
    border-radius: 999px;
    font-weight: 700;
}

    .btn-theme-secondary:hover,
    .theme-btn-secondary:hover,
    .btn-outline-secondary:hover {
        color: var(--text);
        background: rgba(255, 255, 255, 0.09);
        border-color: var(--line-strong);
        transform: translateY(-2px);
    }

.btn-theme-success {
    color: #e9fff8;
    background: var(--success-bg);
    border: 1px solid var(--success-line);
    border-radius: 999px;
    font-weight: 700;
}

    .btn-theme-success:hover {
        color: #e9fff8;
        background: rgba(73, 240, 194, 0.24);
        border-color: var(--success-line);
    }

.btn-theme-warning {
    color: #fff5d1;
    background: var(--warning-bg);
    border: 1px solid var(--warning-line);
    border-radius: 999px;
    font-weight: 700;
}

    .btn-theme-warning:hover {
        color: #fff5d1;
        background: rgba(255, 216, 110, 0.24);
        border-color: var(--warning-line);
    }

.btn-theme-danger {
    color: #ffe4ea;
    background: var(--danger-bg);
    border: 1px solid var(--danger-line);
    border-radius: 999px;
    font-weight: 700;
}

    .btn-theme-danger:hover {
        color: #ffe4ea;
        background: rgba(255, 129, 155, 0.24);
        border-color: var(--danger-line);
    }

/* =========================================================
   FORMS / INPUTS / SELECT / TEXTAREA / CHECKBOX
========================================================= */
.form-control,
.form-select,
textarea,
input,
select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text);
    border-radius: 14px;
    box-shadow: none;
}

    .form-control::placeholder,
    textarea::placeholder,
    input::placeholder {
        color: var(--input-placeholder);
    }

    .form-control:focus,
    .form-select:focus,
    textarea:focus,
    input:focus,
    select:focus {
        background: rgba(255, 255, 255, 0.07);
        color: var(--text);
        border-color: var(--input-border-focus);
        box-shadow: 0 0 0 4px rgba(47, 216, 255, 0.14);
    }

.form-label,
label {
    color: var(--text-soft);
    font-weight: 600;
}

.form-check-input {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--input-border);
}

    .form-check-input:checked {
        background-color: var(--cyan);
        border-color: var(--cyan);
    }

    .form-check-input:focus {
        box-shadow: 0 0 0 4px rgba(47, 216, 255, 0.12);
    }

/* =========================================================
   TABLE
========================================================= */
.table {
    color: var(--text);
    --bs-table-color: var(--text);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--line-soft);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.025);
    --bs-table-hover-bg: rgba(109, 210, 255, 0.08);
}

    .table thead th {
        color: var(--text);
        background: var(--table-head);
        border-bottom: 1px solid var(--line);
    }

    .table tbody tr {
        background: transparent;
    }

    .table tbody td {
        color: var(--text-soft);
        border-color: var(--line-soft);
    }

/* =========================================================
   MODAL / DROPDOWN / MENU
========================================================= */
.modal-content,
.dropdown-menu,
.theme-menu {
    background: linear-gradient(180deg, rgba(20, 39, 56, 0.99), rgba(10, 20, 30, 0.97));
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px);
}

.modal-header,
.modal-footer {
    border-color: var(--line-soft);
}

.dropdown-item {
    color: var(--text);
}

    .dropdown-item:hover,
    .dropdown-item:focus {
        color: var(--text);
        background: rgba(47, 216, 255, 0.10);
    }

.dropdown-divider {
    border-top-color: var(--line-soft);
}

/* =========================================================
   ALERT / BADGE / STATUS
========================================================= */
.alert-theme-info,
.alert-theme-success,
.alert-theme-warning,
.alert-theme-danger {
    border-radius: 16px;
    padding: 14px 16px;
}

.alert-theme-info {
    background: var(--info-bg);
    color: var(--text-soft);
    border: 1px solid var(--info-line);
}

.alert-theme-success {
    background: var(--success-bg);
    color: #d9fff2;
    border: 1px solid var(--success-line);
}

.alert-theme-warning {
    background: var(--warning-bg);
    color: #fff0bf;
    border: 1px solid var(--warning-line);
}

.alert-theme-danger {
    background: var(--danger-bg);
    color: #ffd7df;
    border: 1px solid var(--danger-line);
}

.badge-theme-info {
    background: var(--info-bg);
    color: var(--cyan);
    border: 1px solid var(--info-line);
}

.badge-theme-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-line);
}

.badge-theme-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-line);
}

.badge-theme-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-line);
}

/* =========================================================
   STATUS PILLS
========================================================= */
.theme-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.theme-pill-info {
    background: var(--info-bg);
    color: var(--cyan);
    border: 1px solid var(--info-line);
}

.theme-pill-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-line);
}

.theme-pill-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-line);
}

.theme-pill-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-line);
}

.theme-pill-neutral {
    background: var(--neutral-bg);
    color: var(--neutral);
    border: 1px solid var(--neutral-line);
}

/* =========================================================
   UTILITIES
========================================================= */
.text-theme {
    color: var(--text) !important;
}

.text-theme-muted {
    color: var(--muted) !important;
}

.text-theme-accent {
    color: var(--cyan) !important;
}

.text-theme-teal {
    color: var(--teal) !important;
}

.bg-theme-panel {
    background: linear-gradient(180deg, rgba(20, 39, 56, 0.98), rgba(12, 24, 35, 0.95)) !important;
}

.border-theme {
    border-color: var(--line) !important;
}

.shadow-theme {
    box-shadow: var(--shadow-lg) !important;
}

.round-theme-lg {
    border-radius: var(--radius-lg) !important;
}

.round-theme-md {
    border-radius: var(--radius-md) !important;
}

.round-theme-sm {
    border-radius: var(--radius-sm) !important;
}

/* =========================================================
   CONTENT HELPERS
========================================================= */
.theme-card ul,
.theme-card-soft ul {
    padding-left: 1.1rem;
}

    .theme-card ul li,
    .theme-card-soft ul li {
        margin-bottom: .45rem;
    }

        .theme-card ul li:last-child,
        .theme-card-soft ul li:last-child {
            margin-bottom: 0;
        }

/* =========================================================
   TikTokLive
========================================================= */
pre.theme-card-soft {
    color: var(--text);
    font-family: Consolas, Monaco, monospace;
    font-size: .92rem;
}

.theme-card-soft.is-active,
.tiklive-trigger-card.is-active {
    outline: 2px solid var(--cyan);
    background: rgba(109, 210, 255, 0.12);
    box-shadow: 0 0 0 1px rgba(109, 210, 255, 0.12) inset;
}

/* Gift picker */
.tiklive-gift-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.tiklive-gift-item {
    padding: 12px;
    border-radius: 16px;
    background: var(--panel-soft);
    border: 1px solid var(--line-soft);
    transition: 0.2s ease;
    text-align: center;
}

    .tiklive-gift-item:hover {
        background: var(--panel-hover);
        border-color: var(--line);
        transform: translateY(-2px);
    }

.tiklive-gift-thumb {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto 8px;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
}

.tiklive-gift-name {
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.3;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 767.98px) {
    .app-container,
    .theme-container,
    .container-soft {
        width: min(calc(100% - 24px), var(--max-width));
    }

    .theme-navbar .navbar-collapse {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--line-soft);
    }

    .theme-main-nav,
    .theme-user-nav {
        align-items: stretch !important;
        gap: 8px;
    }

    .theme-main-nav .theme-nav-link,
    .theme-user-nav .theme-nav-link,
    .theme-logout-link {
        width: 100%;
        justify-content: flex-start;
    }

    .theme-user-greeting {
        max-width: none;
    }
}

@media (max-width: 1320px) {
    .theme-main-nav .theme-nav-link,
    .theme-user-nav .theme-nav-link,
    .theme-logout-link {
        padding-inline: 9px !important;
        font-size: .92rem;
    }
}
