/* --- UI Fixes for Readability on Dark/Busy Backgrounds --- */

/* Glass effect for containers - Darker background for FAQ and large sections, but NOT for product cards */
.glass-pane:not(.sl-prodbox),
.panel-group .panel {
    background: rgba(10, 10, 15, 0.85) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 234, 0, 0.25) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

/* Product cards: keep original transparent look from custom-pages.css */
/* Only override active/hold to use gold instead of black */
.sl-prodbox:active,
.sl-prodli:active .sl-prodbox {
    background: rgba(255, 234, 0, 0.08) !important;
    border-color: rgba(255, 234, 0, 0.6) !important;
    box-shadow: 0 0 25px rgba(255, 234, 0, 0.2) !important;
}

/* Base text readability — override inline color:#aaa in page.php */
.seo-section p:not([style*="color: var(--primary-gold)"]) {
    color: #f8f8f8 !important; /* Very near white, just below title brightness */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.glass-pane p,
.glass-pane li,
.panel-group .panel-collapse div,
.activity-widget-col p,
.live-counter-badge,
.activity-item-name,
.activity-time {
    color: #fcfcfc !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* Headings readability — add dark outline/shadow to reduce glare */
.seo-section h1,
.seo-section h2 {
    color: #ffffff !important; /* Absolute brightest */
    text-shadow:
        0 1px 4px rgba(0, 0, 0, 1),
        0 0 20px rgba(0, 0, 0, 0.5) !important;
    font-weight: 800 !important;
}

.seo-section h3 {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* Login/Register button — solid gold by default */
.btn-gold,
.sl-logreg a {
    color: #111111 !important;
    background: linear-gradient(135deg, #ffea00, #f2ac00) !important;
    border: none !important;
    text-shadow: none !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 234, 0, 0.3);
}

.btn-gold:hover,
.sl-logreg a:hover {
    background: linear-gradient(135deg, #fff176, #ffea00) !important;
    color: #000000 !important;
    box-shadow: 0 6px 20px rgba(255, 234, 0, 0.5) !important;
    transform: translateY(-1px);
}

/* PROTECT BUTTONS: Restore gold color for card buttons on dark backgrounds */
.sl-btnod {
    color: var(--primary-gold) !important;
    text-shadow: none !important;
}

.sl-btnod:hover {
    color: #000000 !important;
}

.sl-btn, 
.sl-sebt1, 
.sl-sebt2,
.video-nav-btn {
    color: #000000 !important;
    text-shadow: none !important;
    font-weight: 600 !important;
}

/* Ensure gold text stays gold */
[style*="color: var(--primary-gold)"] {
    color: var(--primary-gold) !important;
}

/* --- Improved Selection & Highlight Colors --- */

/* Text selection color (Bôi đen văn bản) */
::selection {
    background: rgba(255, 234, 0, 0.9);
    color: #000000;
}
::-moz-selection {
    background: rgba(255, 234, 0, 0.9);
    color: #000000;
}

/* Dropdown menu hover highlight (Di chuột vào menu) */
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus,
.sl-lrins .dropdown-menu > li > a:hover {
    background: rgba(255, 234, 0, 0.15) !important;
    color: #ffea00 !important;
}

/* Input focus highlight (Bấm vào ô nhập liệu) */
input:focus, 
textarea:focus, 
select:focus {
    border-color: rgba(255, 234, 0, 0.5) !important;
    box-shadow: 0 0 8px rgba(255, 234, 0, 0.2) !important;
    outline: none !important;
}

/* --- KILL BLACK HOLD/ACTIVE HIGHLIGHTS --- */

/* Globally remove the default dark highlight when clicking/holding */
* {
    -webkit-tap-highlight-color: transparent !important;
}

/* Custom active state for all interactive elements to avoid black-out */
a:active,
button:active,
.sl-btn:active,
.btn-gold:active,
.payment-list-item:active {
    background-color: rgba(255, 234, 0, 0.15) !important;
    transition: background 0s !important;
    outline: none !important;
}

/* .sl-btnod (Xem tất cả): keep bright gold when clicked, not dark */
.sl-btnod:active,
.sl-prodli:hover .sl-btnod:active,
.sl-prodbox .sl-btnod:active {
    background: var(--primary-gold) !important;
    color: #1a1a1a !important;
    border-color: var(--primary-gold) !important;
    box-shadow: 0 0 15px rgba(255, 234, 0, 0.5) !important;
    filter: brightness(1.15);
    outline: none !important;
}

/* Ensure images don't get a dark overlay when held */
img:active {
    opacity: 0.9 !important;
}

/* ── Equal-height card grid ────────────────────────────────────────────────
   Cards in the same row must share height so the buy button always sits at
   the bottom regardless of how much info each card has.
   ──────────────────────────────────────────────────────────────────────── */
.sl-produl {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
}
/* override float-based layout so flex takes over */
.sl-prodli {
    float: none !important;
    display: flex !important;
    flex-direction: column !important;
}
/* fill the full height that .sl-produl gives to .sl-prodli */
.sl-prodbox {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    background: linear-gradient(180deg, #0c0c1e 0%, #09091a 100%) !important;
    border: 1px solid rgba(255, 234, 0, 0.18) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255,255,255,0.03) !important;
}
.sl-prodli:hover .sl-prodbox {
    border-color: rgba(255, 234, 0, 0.5) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 24px rgba(255,234,0,0.12) !important;
}
/* info area below the image fills remaining card height */
.sl-prifs {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 12px !important;
    background: transparent !important;
}
/* content block grows, pushing the buy button to the bottom */
.sl-prifbot {
    flex: 1 !important;
}
/* buy button always at the bottom of the card */
.buy-btn {
    margin-top: auto !important;
    display: block !important;
}

/* ── Grid info rows: subtle row background ── */
.acc-grid-item {
    background: rgba(255, 255, 255, 0.04) !important;
    border-radius: 6px !important;
    padding: 5px 7px !important;
    margin-bottom: 20px !important;
}

/* SweetAlert2 Icon Fix - Tránh bị lệch lên góc */
.swal2-icon {
    margin: 1.25em auto 1.875em !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    box-sizing: content-box !important;
}
.swal2-icon .swal2-icon-content {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}
.swal2-title {
    margin: 0 0 .4em !important;
    padding: 0 !important;
}
.swal2-actions {
    margin: 1.25em auto 0 !important;
}
.swal2-container {
    z-index: 99999 !important;
}
.acc-grid-item:nth-child(even):not(.full) {
    border-left: none !important;
    margin-left: 3px !important;
}

/* ── Typeahead autocomplete dropdown (dark theme) ── */
.typeahead.dropdown-menu {
    background: #111118 !important;
    border: 1px solid rgba(255, 234, 0, 0.3) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8) !important;
    z-index: 99999 !important;
    overflow: hidden;
}
.typeahead.dropdown-menu > li > a {
    color: #f0f0f0 !important;
    background: transparent !important;
    padding: 7px 14px !important;
    font-size: 13px !important;
}
.typeahead.dropdown-menu > li.active > a,
.typeahead.dropdown-menu > li > a:hover,
.typeahead.dropdown-menu > li > a:focus {
    background: rgba(255, 234, 0, 0.15) !important;
    color: #ffea00 !important;
}

/* ── Mobile: seo-header-row stack naturally ── */
@media (max-width: 767px) {
    .seo-header-row {
        display: block !important;
        align-items: unset !important;
    }
    .seo-header-left,
    .activity-widget-col {
        display: block !important;
        height: auto !important;
        margin-bottom: 16px;
    }
    .seo-header-left .glass-pane,
    .activity-widget {
        flex: none !important;
        height: auto !important;
        min-height: 0 !important;
    }
    .activity-scroll-wrap {
        flex: none !important;
        height: auto !important;
        max-height: 220px !important;
        overflow-y: auto !important;
    }

    /* ── Mobile Header: fix logo + login button overlap ── */
    .header-flex-logo span:first-child {
        font-size: 11px !important;
        letter-spacing: 1px !important;
    }
    .header-flex-logo span:last-child {
        font-size: 18px !important;
    }
    .btn-gold {
        padding: 6px 10px !important;
        font-size: 11px !important;
        letter-spacing: 0 !important;
        border-radius: 4px !important;
        white-space: nowrap;
    }
}

