/* ==========================================================================
   AraPlay cookie consent — dark theme, RTL-aware. Plain CSS (no build step).
   ========================================================================== */

#cookie-consent-root *,
#cookie-consent-root *::before,
#cookie-consent-root *::after { box-sizing: border-box; }

/* ---- First layer: bottom banner ---------------------------------------- */
.cc-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 99990;
    max-width: 1100px;
    margin: 0 auto;
    display: none;
    background: var(--bs-gray-900, #14161b);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    padding: 20px 22px;
}
.cc-banner.cc-show { display: block; }

.cc-banner__body { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.cc-banner__text { flex: 1 1 340px; min-width: 260px; }
.cc-banner__title { font-size: 1.05rem; font-weight: 600; margin: 0 0 6px; }
.cc-banner__desc { font-size: 0.9rem; line-height: 1.55; margin: 0; color: rgba(255, 255, 255, 0.78); }
.cc-banner__desc a { color: var(--bs-primary, #e50914); text-decoration: underline; }
.cc-banner__actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* ---- Buttons (Accept / Reject are visually equal — IMY requirement) ----- */
.cc-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}
.cc-btn:hover { opacity: 0.9; }
.cc-btn--primary { background: var(--bs-primary, #e50914); color: #fff; }
.cc-btn--equal  { background: #2a2d35; color: #fff; border-color: rgba(255, 255, 255, 0.18); }
.cc-btn--link   { background: transparent; color: #fff; text-decoration: underline; border: 0; padding: 10px 8px; }

/* ---- Second layer: preferences modal ----------------------------------- */
.cc-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}
.cc-modal.cc-show { display: flex; }
.cc-modal__dialog {
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    overflow-y: auto;
    background: var(--bs-gray-900, #14161b);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    padding: 24px;
}
.cc-modal__title { font-size: 1.2rem; font-weight: 700; margin: 0 0 8px; }
.cc-modal__intro { font-size: 0.88rem; color: rgba(255, 255, 255, 0.75); margin: 0 0 18px; line-height: 1.55; }

.cc-cat {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.02);
}
.cc-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cc-cat__name { font-weight: 600; font-size: 0.98rem; }
.cc-cat__desc { font-size: 0.82rem; color: rgba(255, 255, 255, 0.65); margin: 8px 0 0; line-height: 1.5; }

/* Toggle switch — fully self-contained; overrides any theme input styling. */
.cc-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex: 0 0 46px;
    vertical-align: middle;
}
/* Hide the real checkbox but keep it the clickable layer on top. */
.cc-switch input {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.cc-switch__track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #3a3d45;
    transition: background 0.15s ease;
    pointer-events: none;
}
.cc-switch__track::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease;
}
.cc-switch input:checked ~ .cc-switch__track { background: var(--bs-primary, #e50914); }
.cc-switch input:checked ~ .cc-switch__track::before { transform: translateX(20px); }
.cc-switch input:disabled { cursor: not-allowed; }
.cc-switch input:disabled ~ .cc-switch__track { opacity: 0.55; }

.cc-modal__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; justify-content: flex-end; }

/* ---- Reopen link in footer --------------------------------------------- */
.cc-reopen { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; font: inherit; }

/* ---- RTL ---------------------------------------------------------------- */
[dir="rtl"] .cc-switch__track::before { left: auto; right: 3px; }
[dir="rtl"] .cc-switch input:checked ~ .cc-switch__track::before { transform: translateX(-20px); }
[dir="rtl"] .cc-modal__actions { justify-content: flex-start; }

/* ---- Small screens ------------------------------------------------------ */
@media (max-width: 575.98px) {
    .cc-banner { padding: 16px; left: 8px; right: 8px; bottom: 8px; }
    .cc-banner__actions { width: 100%; }
    .cc-btn { flex: 1 1 auto; text-align: center; }
}
