/* ============================================================
   EduSkill.org — Premium Light-Blue Theme Cookie Consent & Prefs
   ============================================================ */

/* 1. Floating Cookie Banner */
.eduskill-cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    max-width: 500px;
    margin: 0;
    background: #ffffff;
    border: 1px solid #bfdbfe;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(37, 99, 235, 0.05);
    z-index: 999990;
    color: #334155;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    transform: translateY(150%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

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

.eduskill-cookie-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.eduskill-cookie-icon {
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
}

.eduskill-cookie-title {
    font-size: 1.05rem;
    font-weight: 750;
    color: #0f172a;
    margin: 0;
}

.eduskill-cookie-text {
    font-size: 0.84rem;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 18px;
}

.eduskill-cookie-text a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.15s;
}

.eduskill-cookie-text a:hover {
    color: #1d4ed8;
}

/* Button Group */
.eduskill-cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.btn-cookie {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-cookie-accept {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    flex: 1 1 auto;
}

.btn-cookie-accept:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.btn-cookie-reject {
    background: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    flex: 1 1 auto;
}

.btn-cookie-reject:hover {
    background: #f8fafc;
    color: #1e293b;
    border-color: #94a3b8;
}

.btn-cookie-customize {
    background: transparent;
    color: #64748b;
    border: 1px solid transparent;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 6px 12px;
    width: 100%;
    margin-top: 2px;
    font-size: 0.8rem;
}

.btn-cookie-customize:hover {
    color: #0f172a;
}

/* 2. Preferences Modal */
.eduskill-cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999995;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.eduskill-cookie-modal-overlay.show {
    display: flex;
    opacity: 1;
}

.eduskill-cookie-modal {
    background: #ffffff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.15);
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    transform: scale(0.95) translateY(15px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.eduskill-cookie-modal-overlay.show .eduskill-cookie-modal {
    transform: scale(1) translateY(0);
}

.cookie-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 750;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    transition: color 0.15s;
}

.cookie-modal-close:hover {
    color: #0f172a;
}

.cookie-modal-body {
    padding: 20px 24px;
}

.cookie-modal-desc {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 18px;
    line-height: 1.45;
}

/* Cookie Category Card */
.cookie-category-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.cookie-category-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-category-desc {
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.4;
    margin: 0;
}

.cookie-badge-always {
    font-size: 0.75rem;
    font-weight: 700;
    color: #2563eb;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #bfdbfe;
}

/* Switch styling */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .2s;
    border-radius: 34px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .2s;
    border-radius: 50%;
}

input:checked + .cookie-slider {
    background-color: #2563eb;
}

input:checked + .cookie-slider:before {
    transform: translateX(16px);
}

.cookie-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 3. Floating Reopen Trigger */
.eduskill-cookie-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: 1px solid #bfdbfe;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    cursor: pointer;
    display: none;
    opacity: 0;
    pointer-events: none;
    align-items: center;
    justify-content: center;
    z-index: 999980;
    font-size: 16px;
    transition: opacity 0.3s ease, transform 0.2s;
}

.eduskill-cookie-trigger.visible {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.eduskill-cookie-trigger.visible:hover {
    transform: scale(1.08) rotate(15deg);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    .eduskill-cookie-banner {
        bottom: 12px;
        left: 12px;
        right: 12px;
        padding: 16px;
        border-radius: 14px;
    }
    .eduskill-cookie-actions {
        flex-direction: column;
        width: 100%;
    }
    .btn-cookie {
        width: 100%;
    }
    .eduskill-cookie-trigger {
        bottom: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
    .cookie-modal-footer {
        flex-direction: column-reverse;
    }
}
