/* =============================================
   Cookie Consent - Watawdeh Math Center
   Legal cookie consent banner + preferences modal
   Direction: RTL (Arabic)
   ============================================= */

:root {
    --cc-gold: #FFD23F;
    --cc-dark-gold: #E0B71F;
}

/* ---------- Banner ---------- */

.cookie-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    background: #ffffff;
    border-top: 3px solid var(--accent-cyan, #06B6D4);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(110%);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.cookie-consent-banner.cc-visible {
    transform: translateY(0);
}

.cookie-consent-banner.cc-hidden {
    display: none;
}

.cc-banner-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.cc-banner-text {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-gray, #64748B);
    font-size: 0.98rem;
    line-height: 1.7;
}

.cc-banner-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06B6D4, #10B981);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.cc-banner-text strong {
    color: var(--primary-blue, #0F172A);
    font-weight: 700;
}

.cc-banner-text a {
    color: var(--accent-cyan, #06B6D4);
    font-weight: 700;
    text-decoration: underline;
}

.cc-banner-text a:hover {
    color: var(--dark-cyan, #0891B2);
}

.cc-banner-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---------- Buttons ---------- */

.cc-btn {
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    padding: 11px 22px;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    line-height: 1.4;
    white-space: nowrap;
}

.cc-btn-primary {
    background: linear-gradient(135deg, #06B6D4, #10B981);
    color: #fff;
    box-shadow: 0 6px 18px rgba(6, 182, 212, 0.35);
}

.cc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(6, 182, 212, 0.45);
}

.cc-btn-secondary {
    background: #fff;
    color: var(--primary-blue, #0F172A);
    border-color: var(--border-color, #E2E8F0);
}

.cc-btn-secondary:hover {
    border-color: var(--primary-blue, #0F172A);
    background: #F8FAFC;
}

.cc-btn-ghost {
    background: transparent;
    color: var(--text-gray, #64748B);
    border-color: transparent;
    text-decoration: underline;
    padding: 11px 12px;
}

.cc-btn-ghost:hover {
    color: var(--primary-blue, #0F172A);
}

/* ---------- Preferences Modal ---------- */

.cc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cc-modal-overlay.cc-open {
    display: flex;
    opacity: 1;
}

.cc-modal {
    background: #fff;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    transform: translateY(20px) scale(0.98);
    transition: transform 0.3s ease;
}

.cc-modal-overlay.cc-open .cc-modal {
    transform: translateY(0) scale(1);
}

.cc-modal-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, var(--primary-blue, #0F172A), var(--secondary-blue, #1E40AF));
    color: #fff;
    padding: 20px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 18px 18px 0 0;
    z-index: 2;
}

.cc-modal-header h3 {
    margin: 0;
    font-size: 1.35rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cc-modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.2s ease;
    line-height: 1;
}

.cc-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cc-modal-body {
    padding: 24px 26px;
}

.cc-modal-intro {
    color: var(--text-gray, #64748B);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 22px;
    padding: 16px;
    background: #F8FAFC;
    border-radius: 12px;
    border-right: 4px solid var(--cc-gold);
}

.cc-modal-intro a {
    color: var(--accent-cyan, #06B6D4);
    font-weight: 700;
    text-decoration: underline;
}

.cc-category {
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 14px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.cc-category:hover {
    border-color: #CBD5E1;
    background: #FCFCFD;
}

.cc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.cc-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--primary-blue, #0F172A);
    font-size: 1.05rem;
}

.cc-category-title i {
    color: var(--accent-cyan, #06B6D4);
    font-size: 1.1rem;
}

.cc-category-tag {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: #ECFEFF;
    color: var(--dark-cyan, #0891B2);
    margin-right: 8px;
}

.cc-category-desc {
    color: var(--text-gray, #64748B);
    font-size: 0.92rem;
    line-height: 1.7;
    margin-top: 10px;
}

/* Toggle switch */
.cc-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.cc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cc-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #CBD5E1;
    border-radius: 26px;
    transition: background 0.25s ease;
}

.cc-toggle-slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    right: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.cc-toggle input:checked + .cc-toggle-slider {
    background: linear-gradient(135deg, #06B6D4, #10B981);
}

.cc-toggle input:checked + .cc-toggle-slider::before {
    transform: translateX(-22px);
}

.cc-toggle input:disabled + .cc-toggle-slider {
    background: #94A3B8;
    cursor: not-allowed;
    opacity: 0.7;
}

.cc-toggle input:focus-visible + .cc-toggle-slider {
    outline: 3px solid rgba(6, 182, 212, 0.5);
    outline-offset: 2px;
}

.cc-modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 18px 26px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color, #E2E8F0);
    z-index: 2;
}

/* ---------- Footer settings link ---------- */

.cc-settings-link {
    cursor: pointer;
    color: inherit;
}

.cc-settings-link:hover {
    color: var(--accent-cyan, #06B6D4) !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
    .cc-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 18px 18px;
    }

    .cc-banner-text {
        font-size: 0.92rem;
    }

    .cc-banner-actions {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .cc-btn {
        flex: 1;
        min-width: 0;
        padding: 10px 14px;
        font-size: 0.92rem;
    }
}

@media (max-width: 520px) {
    .cc-banner-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .cc-modal-header h3 {
        font-size: 1.15rem;
    }

    .cc-modal-body {
        padding: 18px 16px;
    }

    .cc-modal-footer {
        padding: 14px 16px 18px;
    }

    .cc-modal-footer .cc-btn {
        flex: 1 1 100%;
    }
}
