/* ==========================================================================
   Sainfoxiya — Cookie Consent Banner (DPDPA 2023 Compliant)
   Glassmorphism design, mobile responsive, bottom-fixed
   ========================================================================== */

/* ── Banner Container ── */
.consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    padding: 0;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    pointer-events: none;
}

.consent-banner.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.consent-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25), 0 -2px 12px rgba(79, 70, 229, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

/* ── Shield Icon ── */
.consent-banner-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.25), rgba(124, 58, 237, 0.2));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #a5b4fc;
    border: 1px solid rgba(79, 70, 229, 0.3);
}

/* ── Text Content ── */
.consent-banner-content {
    flex: 1;
    min-width: 0;
}

.consent-banner-title {
    font-family: var(--font-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.35rem;
    letter-spacing: -0.01em;
}

.consent-banner-text {
    font-family: var(--font-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.55;
    margin: 0;
}

.consent-banner-text a {
    color: #a5b4fc;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.consent-banner-text a:hover {
    color: #c4b5fd;
}

/* ── Action Buttons ── */
.consent-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
    padding-top: 0.15rem;
}

.consent-btn {
    font-family: var(--font-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.65rem 1.35rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.consent-btn-accept {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.consent-btn-accept:hover {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
    transform: translateY(-1px);
}

.consent-btn-customize {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.consent-btn-customize:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.2);
}

.consent-btn-reject {
    background: transparent;
    color: #64748b;
    padding: 0.65rem 1rem;
    font-weight: 500;
}

.consent-btn-reject:hover {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
}

/* ── Customize Panel (Expandable) ── */
.consent-customize-panel {
    display: none;
    margin-top: 1.15rem;
    padding-top: 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.consent-customize-panel.active {
    display: block;
    animation: consentFadeIn 0.35s ease;
}

@keyframes consentFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.consent-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.consent-category:last-child {
    border-bottom: none;
}

.consent-category-info {
    flex: 1;
    min-width: 0;
}

.consent-category-label {
    font-family: var(--font-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 0.15rem;
}

.consent-category-desc {
    font-family: var(--font-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
}

.consent-badge-required {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ── Toggle Switch ── */
.consent-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-left: 1rem;
}

.consent-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.consent-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.consent-toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #94a3b8;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.consent-toggle input:checked + .consent-toggle-slider {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.consent-toggle input:checked + .consent-toggle-slider::before {
    transform: translateX(20px);
    background: #ffffff;
}

.consent-toggle input:disabled + .consent-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.consent-toggle input:disabled:checked + .consent-toggle-slider {
    opacity: 0.7;
}

/* ── Save Preferences Button (Inside Panel) ── */
.consent-save-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 0.75rem;
}

.consent-btn-save {
    font-family: var(--font-primary, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.25s ease;
}

.consent-btn-save:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

/* ── DPDPA Compliance Footer Text ── */
.consent-legal-note {
    font-size: 0.72rem;
    color: #475569;
    margin-top: 0.75rem;
    line-height: 1.45;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.consent-legal-note i {
    color: #f59e0b;
    margin-right: 0.3rem;
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
    .consent-banner-inner {
        flex-direction: column;
        padding: 1.25rem 1.15rem;
        gap: 1rem;
        border-radius: 16px 16px 0 0;
    }

    .consent-banner-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        border-radius: 12px;
    }

    .consent-banner-title {
        font-size: 0.95rem;
    }

    .consent-banner-text {
        font-size: 0.8rem;
    }

    .consent-banner-actions {
        width: 100%;
        flex-direction: column;
    }

    .consent-btn {
        width: 100%;
        text-align: center;
        padding: 0.7rem 1rem;
    }

    .consent-category {
        flex-direction: row;
        gap: 0.5rem;
    }

    .consent-toggle {
        margin-left: auto;
    }
}

@media (max-width: 420px) {
    .consent-banner-inner {
        padding: 1rem;
        gap: 0.85rem;
    }

    .consent-banner-icon {
        display: none;
    }

    .consent-btn {
        font-size: 0.82rem;
        padding: 0.65rem 0.85rem;
    }
}
