/**
 * Privacy Compliance Module - Modern Luxury Design v2.1
 * Compatible with Rocket LMS design_1 theme & dark/light modes
 */

/* ----------------------------------------------------
   1. Cookie Consent Banner - Base & Positions
   ---------------------------------------------------- */
.privacy-consent-banner {
    position: fixed;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #f8fafc;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.12);
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Position: Centered Floating Pill (Default) */
.privacy-consent-banner.privacy-pos-bottom-center,
.privacy-consent-banner.privacy-pos-bottom_center {
    bottom: 24px;
    left: 24px;
    right: 24px;
    max-width: 1040px;
    margin: 0 auto;
    border-radius: 20px;
    padding: 20px 26px;
    animation: privacySlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Position: Full Width Bottom Bar */
.privacy-consent-banner.privacy-pos-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 18px 32px;
    animation: privacySlideUpBar 0.35s ease forwards;
}

/* Position: Floating Bottom Left */
.privacy-consent-banner.privacy-pos-bottom-left,
.privacy-consent-banner.privacy-pos-bottom_left {
    bottom: 24px;
    left: 24px;
    right: auto;
    max-width: 440px;
    border-radius: 20px;
    padding: 22px 24px;
    animation: privacySlideUpLeft 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Position: Floating Bottom Right */
.privacy-consent-banner.privacy-pos-bottom-right,
.privacy-consent-banner.privacy-pos-bottom_right {
    bottom: 24px;
    right: 24px;
    left: auto;
    max-width: 440px;
    border-radius: 20px;
    padding: 22px 24px;
    animation: privacySlideUpRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Position: Center Screen Modal */
.privacy-consent-banner.privacy-pos-modal {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    bottom: auto;
    right: auto;
    max-width: 540px;
    width: 90%;
    border-radius: 24px;
    padding: 28px;
    animation: privacyPopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes privacySlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes privacySlideUpBar {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes privacySlideUpLeft {
    from { opacity: 0; transform: translateY(30px) translateX(-20px); }
    to { opacity: 1; transform: translateY(0) translateX(0); }
}
@keyframes privacySlideUpRight {
    from { opacity: 0; transform: translateY(30px) translateX(20px); }
    to { opacity: 1; transform: translateY(0) translateX(0); }
}
@keyframes privacyPopIn {
    from { opacity: 0; transform: translate(-50%, -46%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Compact layout for bottom-left, bottom-right, and modal */
.privacy-consent-banner.privacy-pos-bottom-left .privacy-banner-container,
.privacy-consent-banner.privacy-pos-bottom_left .privacy-banner-container,
.privacy-consent-banner.privacy-pos-bottom-right .privacy-banner-container,
.privacy-consent-banner.privacy-pos-bottom_right .privacy-banner-container,
.privacy-consent-banner.privacy-pos-modal .privacy-banner-container {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
}

.privacy-consent-banner.privacy-pos-bottom-left .privacy-banner-actions,
.privacy-consent-banner.privacy-pos-bottom_left .privacy-banner-actions,
.privacy-consent-banner.privacy-pos-bottom-right .privacy-banner-actions,
.privacy-consent-banner.privacy-pos-bottom_right .privacy-banner-actions,
.privacy-consent-banner.privacy-pos-modal .privacy-banner-actions {
    width: 100%;
    justify-content: stretch;
}

.privacy-consent-banner.privacy-pos-bottom-left .privacy-btn,
.privacy-consent-banner.privacy-pos-bottom_left .privacy-btn,
.privacy-consent-banner.privacy-pos-bottom-right .privacy-btn,
.privacy-consent-banner.privacy-pos-bottom_right .privacy-btn,
.privacy-consent-banner.privacy-pos-modal .privacy-btn {
    flex: 1 1 auto;
    text-align: center;
}

.privacy-banner-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.privacy-banner-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.privacy-banner-text {
    font-size: 13.5px;
    line-height: 1.55;
    color: #cbd5e1;
    margin-bottom: 0;
}

.privacy-banner-text a {
    color: #60a5fa;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
    transition: color 0.2s;
}

.privacy-banner-text a:hover {
    color: #93c5fd;
}

.privacy-banner-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.privacy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: none;
    outline: none;
    white-space: nowrap;
}

.privacy-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
}

.privacy-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.privacy-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
    color: #ffffff !important;
}

.privacy-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9 !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.privacy-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.privacy-btn-outline {
    background: transparent;
    color: #94a3b8 !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.privacy-btn-outline:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* ----------------------------------------------------
   2. Floating Preferences Trigger Widget
   ---------------------------------------------------- */
.privacy-floating-trigger {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999990;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #f8fafc;
    border-radius: 50px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.privacy-floating-trigger:hover {
    transform: translateY(-2px) scale(1.02);
    background: #1e293b;
    border-color: rgba(96, 165, 250, 0.5);
    color: #ffffff;
    box-shadow: 0 14px 30px -5px rgba(37, 99, 235, 0.35);
}

/* ----------------------------------------------------
   3. Preferences Customization Modal
   ---------------------------------------------------- */
#privacyPreferencesModal .modal-content {
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.25);
    background: #ffffff;
    overflow: hidden;
}

#privacyPreferencesModal .modal-header {
    padding: 24px 28px 12px 28px;
    border-bottom: none;
}

#privacyPreferencesModal .modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

#privacyPreferencesModal .modal-header .close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    opacity: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    transition: all 0.2s ease;
    border: none;
}

#privacyPreferencesModal .modal-header .close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: scale(1.05);
}

#privacyPreferencesModal .modal-body {
    padding: 16px 28px 20px 28px;
    max-height: 65vh;
    overflow-y: auto;
}

/* Custom Scrollbar for Modal */
#privacyPreferencesModal .modal-body::-webkit-scrollbar {
    width: 6px;
}
#privacyPreferencesModal .modal-body::-webkit-scrollbar-track {
    background: #f8fafc;
}
#privacyPreferencesModal .modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.privacy-category-card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.privacy-category-card:hover {
    border-color: #cbd5e1;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.privacy-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.privacy-category-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0;
}

.privacy-category-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: #dbeafe;
    color: #1d4ed8;
    display: inline-block;
    margin-left: 8px;
}

.privacy-category-desc {
    font-size: 13px;
    line-height: 1.55;
    color: #64748b;
    margin-top: 8px;
    margin-bottom: 0;
}

/* ----------------------------------------------------
   4. Custom iOS Style Toggle Switch
   ---------------------------------------------------- */
.privacy-ios-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.privacy-ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.privacy-ios-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 30px;
}

.privacy-ios-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.privacy-ios-switch input:checked + .privacy-ios-slider {
    background-color: #3b82f6;
}

.privacy-ios-switch input:checked + .privacy-ios-slider:before {
    transform: translateX(22px);
}

.privacy-ios-switch input:disabled + .privacy-ios-slider {
    background-color: #3b82f6;
    opacity: 0.65;
    cursor: not-allowed;
}

#privacyPreferencesModal .modal-footer {
    padding: 16px 28px 24px 28px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ----------------------------------------------------
   5. Mobile Responsiveness (Mobile First)
   ---------------------------------------------------- */
@media (max-width: 768px) {
    .privacy-consent-banner,
    .privacy-consent-banner.privacy-pos-bottom-center,
    .privacy-consent-banner.privacy-pos-bottom_center,
    .privacy-consent-banner.privacy-pos-bottom-left,
    .privacy-consent-banner.privacy-pos-bottom_left,
    .privacy-consent-banner.privacy-pos-bottom-right,
    .privacy-consent-banner.privacy-pos-bottom_right,
    .privacy-consent-banner.privacy-pos-modal {
        bottom: 12px !important;
        left: 12px !important;
        right: 12px !important;
        top: auto !important;
        transform: none !important;
        max-width: 100% !important;
        width: auto !important;
        padding: 16px 18px !important;
        border-radius: 18px !important;
    }

    .privacy-consent-banner .privacy-banner-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
    }

    .privacy-banner-actions {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .privacy-banner-actions .privacy-btn {
        width: 100% !important;
        text-align: center !important;
        padding: 11px 16px !important;
    }

    #privacyPreferencesModal .modal-footer {
        flex-direction: column-reverse;
        gap: 10px;
        padding: 16px 20px 20px 20px;
    }

    #privacyPreferencesModal .modal-footer > div {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    #privacyPreferencesModal .modal-footer .btn {
        width: 100%;
    }

    .privacy-floating-trigger {
        bottom: 16px;
        left: 16px;
        padding: 7px 14px;
        font-size: 12px;
    }
}
