/**
 * Cookie Consent Banner Styles
 * GDPR & CCPA Compliant
 * Responsive & Accessible
 * Fully Visible with Expandable Modal
 */

#cookie-consent-container {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 99990;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.12);
    border-top: 4px solid #1abc9c;
    max-height: 50vh;
    overflow-y: auto;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    z-index: 99990;
    font-family: 'Cairo', 'Inter', sans-serif;
    transform: translateY(100%);
}

.cookie-consent-banner.show {
    transform: translateY(0);
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-consent-content {
    max-width: 100%;
    margin: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cookie-consent-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

.cookie-consent-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1abc9c;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    line-height: 1.4;
}

.cookie-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cookie-close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.cookie-close-btn:focus {
    outline: 2px solid #1abc9c;
    outline-offset: 2px;
}

.cookie-consent-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cookie-consent-intro {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.cookie-consent-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    padding: 8px 0;
    max-height: 200px;
    overflow-y: auto;
}

.cookie-category {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.cookie-category:hover {
    border-color: #1abc9c;
    background: #f0fffe;
}

.cookie-category-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 6px;
}

.cookie-category-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #1abc9c;
    border-radius: 4px;
    border: 2px solid #ccc;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cookie-category-checkbox:checked {
    background-color: #1abc9c;
    border-color: #1abc9c;
}

.cookie-category-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.cookie-category-checkbox:focus {
    outline: 2px solid #1abc9c;
    outline-offset: 2px;
}

.cookie-category-name {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.cookie-required {
    font-size: 11px;
    color: #999;
    font-weight: 400;
}

.cookie-category-description {
    margin: 0;
    font-size: 12px;
    color: #888;
    line-height: 1.5;
    padding-left: 30px;
}

.cookie-consent-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    margin-top: 8px;
}

.cookie-consent-links a {
    color: #1abc9c;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
    cursor: pointer;
}

.cookie-consent-links a:hover {
    color: #16a085;
    border-bottom-color: #1abc9c;
}

.cookie-consent-links a:focus {
    outline: 2px solid #1abc9c;
    outline-offset: 2px;
    border-radius: 2px;
}

.separator {
    color: #ddd;
}

.cookie-consent-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.cookie-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', 'Inter', sans-serif;
    min-width: 140px;
    text-align: center;
}

.cookie-btn-primary {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(26, 188, 156, 0.3);
}

.cookie-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 188, 156, 0.4);
}

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

.cookie-btn-primary:focus {
    outline: 2px solid #1abc9c;
    outline-offset: 2px;
}

.cookie-btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.cookie-btn-secondary:hover {
    background: #e8e8e8;
    border-color: #ccc;
    transform: translateY(-1px);
}

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

.cookie-btn-secondary:focus {
    outline: 2px solid #333;
    outline-offset: 2px;
}

/* Modal Styles */
#cookie-policy-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99991;
    padding: 20px;
    overflow-y: auto;
}

#cookie-policy-modal.show {
    display: flex;
}

.cookie-policy-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cookie-policy-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #1abc9c;
}

.cookie-policy-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1abc9c;
}

.cookie-policy-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cookie-policy-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.cookie-policy-modal-body {
    font-size: 14px;
    color: #555;
    line-height: 1.8;
}

.cookie-policy-modal-body h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1abc9c;
    margin-top: 20px;
    margin-bottom: 12px;
}

.cookie-policy-modal-body p {
    margin: 0 0 16px 0;
}

.cookie-policy-modal-body ul {
    margin: 12px 0;
    padding-left: 24px;
}

.cookie-policy-modal-body li {
    margin: 8px 0;
}

/* Tablet and smaller screens */
@media (max-width: 768px) {
    .cookie-consent-banner {
        max-height: 60vh;
    }

    .cookie-consent-content {
        padding: 20px;
        gap: 14px;
    }

    .cookie-consent-header h2 {
        font-size: 16px;
    }

    .cookie-consent-categories {
        grid-template-columns: 1fr;
        max-height: 150px;
    }

    .cookie-consent-actions {
        flex-direction: column;
        gap: 10px;
    }

    .cookie-btn {
        width: 100%;
        min-width: unset;
    }

    .cookie-consent-intro {
        font-size: 13px;
    }

    .cookie-policy-modal-content {
        padding: 24px;
        max-height: 85vh;
    }

    .cookie-policy-modal-header h2 {
        font-size: 20px;
    }

    .cookie-policy-modal-body {
        font-size: 13px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .cookie-consent-banner {
        max-height: 65vh;
    }

    .cookie-consent-content {
        padding: 16px;
        gap: 12px;
    }

    .cookie-consent-header {
        gap: 12px;
        margin-bottom: 4px;
    }

    .cookie-consent-header h2 {
        font-size: 15px;
    }

    .cookie-close-btn {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }

    .cookie-consent-intro {
        font-size: 12px;
    }

    .cookie-category {
        padding: 10px;
    }

    .cookie-category-name {
        font-size: 12px;
    }

    .cookie-category-description {
        font-size: 11px;
        padding-left: 28px;
    }

    .cookie-btn {
        padding: 10px 16px;
        font-size: 13px;
        min-width: 100px;
    }

    .cookie-consent-links {
        font-size: 11px;
        gap: 8px;
    }

    .cookie-consent-categories {
        max-height: 120px;
    }

    .cookie-policy-modal-content {
        padding: 16px;
        max-height: 90vh;
    }

    .cookie-policy-modal-header h2 {
        font-size: 18px;
    }

    .cookie-policy-modal-header {
        margin-bottom: 16px;
    }

    .cookie-policy-modal-body {
        font-size: 12px;
    }

    .cookie-policy-modal-body h3 {
        font-size: 14px;
        margin-top: 16px;
    }

    #cookie-policy-modal {
        padding: 12px;
    }
}

/* RTL Support (Arabic) */
[dir="rtl"] .cookie-consent-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .cookie-category-label {
    flex-direction: row-reverse;
}

[dir="rtl"] .cookie-category-description {
    padding-left: 0;
    padding-right: 30px;
}

[dir="rtl"] .cookie-consent-links {
    flex-direction: row-reverse;
}

[dir="rtl"] .cookie-policy-modal-header {
    flex-direction: row-reverse;
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .cookie-btn,
    .cookie-close-btn,
    .cookie-category {
        transition: none;
        animation: none;
    }
}

/* Accessibility: High Contrast */
@media (prefers-contrast: more) {
    .cookie-consent-banner {
        border-top-width: 6px;
    }

    .cookie-btn {
        border: 2px solid currentColor;
    }

    .cookie-category {
        border-width: 2px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .cookie-consent-banner {
        background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
        border-top-color: #1abc9c;
    }

    .cookie-consent-header h2 {
        color: #1abc9c;
    }

    .cookie-close-btn {
        color: #aaa;
    }

    .cookie-close-btn:hover {
        background: #333;
        color: #fff;
    }

    .cookie-consent-intro {
        color: #ccc;
    }

    .cookie-category {
        background: #2a2a2a;
        border-color: #3a3a3a;
    }

    .cookie-category:hover {
        background: #2f3f3f;
        border-color: #1abc9c;
    }

    .cookie-category-name {
        color: #fff;
    }

    .cookie-category-description {
        color: #999;
    }

    .cookie-btn-secondary {
        background: #333;
        color: #fff;
        border-color: #555;
    }

    .cookie-btn-secondary:hover {
        background: #444;
        border-color: #666;
    }

    .cookie-policy-modal-content {
        background: #1a1a1a;
        color: #ccc;
    }

    .cookie-policy-modal-header {
        border-bottom-color: #1abc9c;
    }

    .cookie-policy-modal-header h2 {
        color: #1abc9c;
    }

    .cookie-policy-modal-body h3 {
        color: #1abc9c;
    }
}

/* Print Styles */
@media print {
    #cookie-consent-container,
    #cookie-policy-modal {
        display: none;
    }
}
