/* ==========================================
   GDPR Cookie Consent Banner Styles
   ========================================== */

/* Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: var(--card-bg, #ffffff);
    border-top: 1px solid var(--border-color, rgba(0,0,0,0.1));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 1.25rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Tajawal', sans-serif;
}

.cookie-banner.active {
    transform: translateY(0);
}

.cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 280px;
}

.cookie-message {
    color: var(--text, #1f2937);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 0.4rem 0;
}

.cookie-privacy-link {
    color: var(--primary, #17c3b2);
    font-size: 0.85rem;
    text-decoration: underline;
    transition: opacity 0.2s;
}

.cookie-privacy-link:hover {
    opacity: 0.8;
}

.cookie-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Buttons */
.cookie-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: 'Tajawal', sans-serif;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, #17c3b2, #15a89a);
    color: #fff;
}

.cookie-btn-accept:hover {
    background: linear-gradient(135deg, #15a89a, #128a7e);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 195, 178, 0.3);
}

.cookie-btn-reject {
    background: var(--card-bg, #f3f4f6);
    color: var(--text, #1f2937);
    border: 1px solid var(--border-color, rgba(0,0,0,0.15));
}

.cookie-btn-reject:hover {
    background: var(--bg, #e5e7eb);
}

.cookie-btn-settings {
    background: transparent;
    color: var(--primary, #17c3b2);
    border: 1px solid var(--primary, #17c3b2);
}

.cookie-btn-settings:hover {
    background: var(--primary, #17c3b2);
    color: #fff;
}

/* Settings Modal */
.cookie-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cookie-modal.active {
    display: flex;
}

.cookie-modal-content {
    background: var(--card-bg, #ffffff);
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: cookieModalIn 0.3s ease;
}

@keyframes cookieModalIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.1));
}

.cookie-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text, #1f2937);
    font-weight: 700;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-light, #6b7280);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.cookie-modal-close:hover {
    color: var(--text, #1f2937);
}

.cookie-modal-body {
    padding: 1.25rem 1.5rem;
}

.cookie-option {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.06));
}

.cookie-option:last-child {
    border-bottom: none;
}

.cookie-option-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.cookie-option-title {
    font-weight: 600;
    color: var(--text, #1f2937);
    font-size: 0.95rem;
}

.cookie-option-desc {
    color: var(--text-light, #6b7280);
    font-size: 0.85rem;
    margin: 0;
    padding-left: 3.5rem;
    line-height: 1.5;
}

[dir="rtl"] .cookie-option-desc {
    padding-left: 0;
    padding-right: 3.5rem;
}

/* Toggle Switch */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border-radius: 24px;
    transition: 0.3s;
}

.cookie-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.cookie-switch input:checked + .cookie-slider {
    background: #17c3b2;
}

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

.cookie-switch input:disabled + .cookie-slider {
    background: #17c3b2;
    opacity: 0.7;
    cursor: not-allowed;
}

.cookie-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color, rgba(0,0,0,0.1));
    display: flex;
    justify-content: flex-end;
}

[dir="rtl"] .cookie-modal-footer {
    justify-content: flex-start;
}

/* Mobile */
@media (max-width: 640px) {
    .cookie-banner {
        padding: 1rem;
    }

    .cookie-banner-inner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .cookie-actions {
        justify-content: center;
        width: 100%;
    }

    .cookie-btn {
        flex: 1;
        min-width: 0;
        padding: 0.55rem 0.8rem;
        font-size: 0.82rem;
    }

    .cookie-modal-content {
        max-height: 90vh;
    }

    .cookie-option-desc {
        padding-left: 0;
        padding-right: 0;
    }
}
