/*
 * policy-consent.css
 * Global blocking popup for policy acceptance.
 * Loaded on every page via header.php.
 */

/* ============================================================
   BODY LOCK — Prevent scrolling & interaction behind popup
   ============================================================ */
body.policy-consent-active {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    touch-action: none;
}

body.policy-consent-active > *:not(.policy-consent-overlay) {
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* Exception: Allow 2FA modal to remain interactive above the policy lock */
body.policy-consent-active > #custom-modal-overlay {
    pointer-events: auto !important;
    user-select: auto !important;
    -webkit-user-select: auto !important;
}

/* ============================================================
   OVERLAY
   ============================================================ */
.policy-consent-overlay {
    position: fixed;
    inset: 0;
    z-index: 9997;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    animation: policyConsentFadeIn 0.4s ease forwards;
    pointer-events: auto !important;
}

@keyframes policyConsentFadeIn {
    to { opacity: 1; }
}

/* ============================================================
   CARD
   ============================================================ */
.policy-consent-card {
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    background: rgba(15, 17, 26, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.97);
    animation: policyConsentSlideUp 0.4s ease 0.1s forwards;
}

@keyframes policyConsentSlideUp {
    to {
        transform: translateY(0) scale(1);
    }
}

/* ============================================================
   HEADER
   ============================================================ */
.policy-consent-header {
    padding: 28px 32px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.policy-consent-header h2 {
    margin: 0 0 8px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.policy-consent-header p {
    margin: 0;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
}

/* ============================================================
   TABS
   ============================================================ */
.policy-consent-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 24px;
    gap: 0;
}

.policy-consent-tab {
    flex: 1;
    padding: 12px 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease;
    text-align: center;
    white-space: nowrap;
}

.policy-consent-tab:hover {
    color: rgba(255, 255, 255, 0.7);
}

.policy-consent-tab.active {
    color: #4a90e2;
    border-bottom-color: #4a90e2;
}

.policy-consent-tab.completed {
    color: #28a745;
    border-bottom-color: #28a745;
}

.policy-consent-tab.completed::after {
    content: ' \2713';
}

/* ============================================================
   BODY (scrollable policy content)
   ============================================================ */
.policy-consent-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    min-height: 0;
    position: relative;
}

/* Policy content containers */
.policy-consent-content {
    display: none;
}

.policy-consent-content.active {
    display: block;
}

/* Policy HTML typography */
.policy-consent-body h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
}

.policy-consent-body h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 20px 0 8px;
}

.policy-consent-body h5 {
    font-size: 0.88rem;
    font-weight: 600;
    color: #cbd5e0;
    margin: 16px 0 6px;
}

.policy-consent-body p {
    font-size: 0.88rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 10px;
}

.policy-consent-body ul {
    margin: 8px 0 12px 0;
    padding-left: 20px;
}

.policy-consent-body li {
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 4px;
}

.policy-consent-body strong {
    color: rgba(255, 255, 255, 0.85);
}

/* Loading state */
.policy-consent-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

/* Scroll indicator */
.policy-consent-scroll-hint {
    text-align: center;
    padding: 8px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: none;
}

.policy-consent-scroll-hint.visible {
    display: block;
}

/* Scrollbar */
.policy-consent-body::-webkit-scrollbar {
    width: 6px;
}

.policy-consent-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.policy-consent-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.policy-consent-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ============================================================
   FOOTER
   ============================================================ */
.policy-consent-footer {
    padding: 16px 32px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

.policy-consent-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    user-select: none;
}

.policy-consent-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4a90e2;
    cursor: pointer;
    flex-shrink: 0;
}

.policy-consent-checkbox-label input[type="checkbox"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.policy-consent-accept-btn {
    width: 100%;
    max-width: 320px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: #4a90e2;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.25s ease, opacity 0.25s ease, transform 0.2s ease;
}

.policy-consent-accept-btn:hover:not(:disabled) {
    background: #5aa1f2;
    transform: translateY(-1px);
}

.policy-consent-accept-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
    .policy-consent-card {
        max-height: 90vh;
        border-radius: 12px;
    }

    .policy-consent-header {
        padding: 20px 20px 16px;
    }

    .policy-consent-header h2 {
        font-size: 1.2rem;
    }

    .policy-consent-tabs {
        padding: 0 12px;
    }

    .policy-consent-tab {
        font-size: 0.75rem;
        padding: 10px 4px;
    }

    .policy-consent-body {
        padding: 16px 20px;
    }

    .policy-consent-footer {
        padding: 14px 20px 20px;
    }
}

/* ============================================================
   EARTH SKY THEME
   ============================================================ */
html.theme-earth-sky .policy-consent-overlay {
    background: rgba(200, 215, 230, 0.92);
}

html.theme-earth-sky .policy-consent-card {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

html.theme-earth-sky .policy-consent-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

html.theme-earth-sky .policy-consent-header h2 {
    color: #1a2332;
}

html.theme-earth-sky .policy-consent-header p {
    color: rgba(0, 0, 0, 0.55);
}

html.theme-earth-sky .policy-consent-tabs {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

html.theme-earth-sky .policy-consent-tab {
    color: rgba(0, 0, 0, 0.4);
}

html.theme-earth-sky .policy-consent-tab:hover {
    color: rgba(0, 0, 0, 0.7);
}

html.theme-earth-sky .policy-consent-tab.active {
    color: #4a90e2;
}

html.theme-earth-sky .policy-consent-tab.completed {
    color: #28a745;
}

html.theme-earth-sky .policy-consent-body h3 {
    color: #1a2332;
}

html.theme-earth-sky .policy-consent-body h4 {
    color: #2d3748;
}

html.theme-earth-sky .policy-consent-body h5 {
    color: #4a5568;
}

html.theme-earth-sky .policy-consent-body p {
    color: rgba(0, 0, 0, 0.7);
}

html.theme-earth-sky .policy-consent-body li {
    color: rgba(0, 0, 0, 0.65);
}

html.theme-earth-sky .policy-consent-body strong {
    color: rgba(0, 0, 0, 0.85);
}

html.theme-earth-sky .policy-consent-footer {
    border-top-color: rgba(0, 0, 0, 0.08);
}

html.theme-earth-sky .policy-consent-checkbox-label {
    color: rgba(0, 0, 0, 0.7);
}

html.theme-earth-sky .policy-consent-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

html.theme-earth-sky .policy-consent-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}
