/* ============================================================
   PAN ENGINEERS - COOKIE & CACHE CONSENT BANNER & MODAL CSS
============================================================ */

/* 1. Floating Bottom Banner */
.pe-cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(56, 189, 248, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 30px rgba(14, 165, 233, 0.15);
    z-index: 99980;
    padding: 20px 28px;
    color: #ffffff;
    font-family: inherit;
    transform: translateY(140%);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
}

.pe-cookie-banner.show {
    transform: translateY(0);
    opacity: 1;
}

.cookie-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
}

.cookie-banner-content {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    min-width: 280px;
}

.cookie-icon-box {
    width: 48px;
    height: 48px;
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.cookie-text-box {
    flex: 1;
}

.cookie-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.cookie-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #94a3b8;
}

/* 3 Buttons Actions Group */
.cookie-actions-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-cookie-accept-all {
    padding: 12px 22px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-cookie-accept-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(14, 165, 233, 0.55);
}

.btn-cookie-reject {
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-cookie-reject:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-cookie-settings {
    padding: 12px 16px;
    background: transparent;
    color: #38bdf8;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-cookie-settings:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
}

/* 2. Preferences Modal */
.pe-cookie-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(6px);
    z-index: 99990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.pe-cookie-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.pe-cookie-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 600px;
    max-width: 92vw;
    max-height: 88vh;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    z-index: 99995;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    overflow: hidden;
}

.pe-cookie-modal.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.cookie-modal-header {
    padding: 22px 28px;
    background: linear-gradient(135deg, #071529 0%, #0c2340 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.c-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.c-modal-icon {
    font-size: 28px;
}

.c-modal-title-wrap h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
}

.c-modal-title-wrap p {
    margin: 3px 0 0;
    font-size: 12px;
    color: #94a3b8;
}

.cookie-modal-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.cookie-modal-close:hover {
    background: rgba(239, 68, 68, 0.8);
}

.cookie-modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cookie-category-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 20px;
    transition: border-color 0.2s ease;
}

.cookie-category-card:hover {
    border-color: #cbd5e1;
}

.c-cat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.c-cat-info {
    flex: 1;
}

.c-cat-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.c-cat-badge.required {
    background: #ecfdf5;
    color: #059669;
}

.c-cat-badge.optional {
    background: #eff6ff;
    color: #2563eb;
}

.c-cat-info h4 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}

.c-cat-info p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #64748b;
}

/* iOS Style Switch */
.c-toggle-wrapper {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
    margin-top: 4px;
}

.c-toggle-checkbox {
    display: none;
}

.c-toggle-switch {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.c-toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.c-toggle-checkbox:checked + .c-toggle-switch {
    background: #0ea5e9;
}

.c-toggle-checkbox:checked + .c-toggle-switch::after {
    transform: translateX(22px);
}

.c-toggle-switch.locked {
    background: #059669 !important;
    cursor: not-allowed;
    opacity: 0.85;
}

.cookie-modal-footer {
    padding: 18px 28px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cookie-save-prefs {
    padding: 12px 20px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cookie-save-prefs:hover {
    background: #e2e8f0;
}

.btn-cookie-modal-accept {
    padding: 12px 22px;
    background: #0ea5e9;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cookie-modal-accept:hover {
    background: #0284c7;
}

/* 3. Persistent Floating Trigger Button (Bottom Left) */
.pe-cookie-trigger-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: #ffffff;
    color: #0f172a;
    border: 1.5px solid #cbd5e1;
    border-radius: 50px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 99970;
    transition: all 0.25s ease;
}

.pe-cookie-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-color: #0ea5e9;
    color: #0ea5e9;
}

.c-trigger-icon {
    font-size: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .pe-cookie-banner {
        bottom: 12px;
        left: 12px;
        right: 12px;
        padding: 16px 20px;
    }
    .cookie-actions-group {
        width: 100%;
    }
    .btn-cookie-accept-all,
    .btn-cookie-reject,
    .btn-cookie-settings {
        flex: 1;
        text-align: center;
        padding: 10px 12px;
        font-size: 12px;
    }
    .pe-cookie-trigger-btn .c-trigger-text {
        display: none; /* Just show cookie icon on small mobile */
    }
    .pe-cookie-trigger-btn {
        padding: 10px;
        border-radius: 50%;
    }
}
