/* ================================================
   B-COM Cookie Consent Management Styles
   Compliant with Israeli Privacy Protection Law
   ================================================ */

/* Cookie Consent Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    color: #000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9900;
    padding: 25px 20px;
    display: none;
    border-top: 4px solid #05f88e;
    font-family: Arial, sans-serif;
}

.cookie-consent-banner.show {
    display: block;
}

.cookie-consent-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

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

.cookie-consent-text p {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.cookie-consent-links {
    margin-top: 8px;
}

.cookie-consent-links a {
    color: #05f88e;
    text-decoration: underline;
    margin: 0 10px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.cookie-consent-links a:hover {
    color: #04d97a;
}

.cookie-consent-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cookie-btn:focus {
    outline: 3px solid #05f88e;
    outline-offset: 2px;
}

.cookie-btn-accept {
    background-color: #05f88e;
    color: #000;
}

.cookie-btn-accept:hover {
    background-color: #04d97a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(5, 248, 142, 0.3);
}

.cookie-btn-reject {
    background-color: #f5f5f5;
    color: #000;
    border: 2px solid #ccc;
}

.cookie-btn-reject:hover {
    background-color: #e8e8e8;
    border-color: #999;
}

.cookie-btn-manage {
    background-color: #000;
    color: #05f88e;
    border: 2px solid #05f88e;
}

.cookie-btn-manage:hover {
    background-color: #05f88e;
    color: #000;
}

/* Cookie Preferences Modal */
.cookie-preferences-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9950;
    display: none;
    align-items: center;
    justify-content: center;
}

.cookie-preferences-overlay.show {
    display: flex;
}

.cookie-preferences-modal {
    background-color: #fff;
    color: #000;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cookie-preferences-header {
    background-color: #000;
    color: #05f88e;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-preferences-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
}

.cookie-close-btn {
    background: none;
    border: none;
    color: #05f88e;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

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

.cookie-close-btn:focus {
    outline: 3px solid #05f88e;
    outline-offset: 2px;
}

.cookie-preferences-content {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.cookie-preferences-intro {
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

.cookie-category {
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border-right: 4px solid #05f88e;
}

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

.cookie-category-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: bold;
    color: #000;
}

.cookie-category-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #555;
    margin: 0;
}

.cookie-category-badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: #05f88e;
    color: #000;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 12px;
    margin-right: 10px;
}

/* Cookie Toggle Switches (matching accessibility widget) */
.cookie-toggle {
    width: 50px;
    height: 26px;
    background-color: #ccc;
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cookie-toggle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s ease;
}

.cookie-toggle.active {
    background-color: #05f88e;
}

.cookie-toggle.active::after {
    transform: translateX(24px);
}

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

.cookie-toggle:focus {
    outline: 3px solid #05f88e;
    outline-offset: 2px;
}

.cookie-preferences-footer {
    padding: 20px 25px;
    background-color: #f5f5f5;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border-top: 2px solid #e0e0e0;
}

.cookie-preferences-footer .cookie-btn {
    flex: 1;
    min-width: 120px;
}

.cookie-btn-save {
    background-color: #05f88e;
    color: #000;
}

.cookie-btn-save:hover {
    background-color: #04d97a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(5, 248, 142, 0.3);
}

/* Footer Cookie Settings Link */
#cookieSettingsLink {
    cursor: pointer;
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

#cookieSettingsLink:hover {
    color: #05f88e;
}

/* Screen Reader Only */
.cookie-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 20px 15px;
    }

    .cookie-consent-container {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-consent-text {
        min-width: 100%;
    }

    .cookie-consent-buttons {
        width: 100%;
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        text-align: center;
    }

    .cookie-preferences-modal {
        width: 95%;
        max-height: 90vh;
    }

    .cookie-preferences-header {
        padding: 15px 20px;
    }

    .cookie-preferences-header h2 {
        font-size: 1.3rem;
    }

    .cookie-preferences-content {
        padding: 20px;
    }

    .cookie-category {
        padding: 15px;
    }

    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cookie-preferences-footer {
        flex-direction: column;
        padding: 15px 20px;
    }

    .cookie-preferences-footer .cookie-btn {
        width: 100%;
    }

    .cookie-consent-links a {
        display: inline-block;
        margin: 5px 10px 5px 0;
    }
}

/* Ensure compatibility with accessibility widget */
body.accessibility-high-contrast .cookie-consent-banner,
body.accessibility-high-contrast .cookie-preferences-modal {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

body.accessibility-high-contrast .cookie-btn-accept {
    background-color: #05f88e !important;
    color: #000 !important;
}

body.accessibility-high-contrast .cookie-category {
    background-color: #000 !important;
    border-color: #05f88e !important;
}

body.accessibility-grayscale .cookie-consent-banner,
body.accessibility-grayscale .cookie-preferences-modal {
    filter: none !important;
}

/* Animation for banner appearance */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-consent-banner.show {
    animation: slideUp 0.4s ease-out;
}

/* Animation for modal appearance */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.cookie-preferences-overlay.show {
    animation: fadeIn 0.3s ease-out;
}

.cookie-preferences-overlay.show .cookie-preferences-modal {
    animation: scaleIn 0.3s ease-out;
}

/* Scrollbar styling for modal */
.cookie-preferences-content::-webkit-scrollbar {
    width: 8px;
}

.cookie-preferences-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cookie-preferences-content::-webkit-scrollbar-thumb {
    background: #05f88e;
    border-radius: 4px;
}

.cookie-preferences-content::-webkit-scrollbar-thumb:hover {
    background: #04d97a;
}

/* RTL Support */
[dir="rtl"] .cookie-consent-buttons {
    direction: rtl;
}

[dir="rtl"] .cookie-category {
    border-right: none;
    border-left: 4px solid #05f88e;
}

[dir="rtl"] .cookie-toggle::after {
    right: 3px;
    left: auto;
}

[dir="rtl"] .cookie-toggle.active::after {
    transform: translateX(-24px);
}
