/**
 * Cookie Consent Management CSS
 * Blue and white color scheme as preferred
 */

/* CSS Variables for easy customization */
:root {
    --cookie-banner-bg: #ffffff;
    --cookie-banner-text: #333333;
    --cookie-accept-color: #007cba;
    --cookie-reject-color: #dc3545;
    --cookie-border-color: #007cba;
    --cookie-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --cookie-border-radius: 8px;
    --cookie-transition: all 0.3s ease;
}

/* Reset and base styles */
.cookie-consent-banner *,
.cookie-settings-modal *,
.cookie-settings-float * {
    box-sizing: border-box;
}

/* Cookie Banner Styles */
.cookie-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 999999;
    background: var(--cookie-banner-bg);
    border: 2px solid var(--cookie-border-color);
    box-shadow: var(--cookie-shadow);
    padding: 20px;
    margin: 20px;
    border-radius: var(--cookie-border-radius);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--cookie-transition);
}

.cookie-consent-banner.show {
    transform: translateY(0);
    opacity: 1;
}

/* Banner positions */
.cookie-consent-banner.cookie-consent-bottom {
    bottom: 0;
    transform: translateY(100%);
}

.cookie-consent-banner.cookie-consent-bottom.show {
    transform: translateY(0);
}

.cookie-consent-banner.cookie-consent-top {
    top: 0;
    transform: translateY(-100%);
}

.cookie-consent-banner.cookie-consent-top.show {
    transform: translateY(0);
}

.cookie-consent-banner.cookie-consent-center {
    top: 50%;
    left: 50%;
    right: auto;
    max-width: 600px;
    margin: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

.cookie-consent-banner.cookie-consent-center.show {
    transform: translate(-50%, -50%) scale(1);
}

/* Banner container */
.cookie-consent-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Banner content */
.cookie-consent-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.cookie-consent-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.cookie-consent-text {
    color: var(--cookie-banner-text);
    line-height: 1.5;
}

.cookie-consent-text p {
    margin: 0 0 8px 0;
}

.cookie-consent-text p:last-child {
    margin-bottom: 0;
}

.cookie-consent-privacy-link {
    font-size: 14px;
}

.cookie-consent-privacy-link a {
    color: var(--cookie-accept-color);
    text-decoration: underline;
}

.cookie-consent-privacy-link a:hover {
    text-decoration: none;
}

/* Banner buttons */
.cookie-consent-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.cookie-consent-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--cookie-transition);
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.cookie-consent-accept {
    background: var(--cookie-accept-color);
    color: white;
    border: 2px solid var(--cookie-accept-color);
}

.cookie-consent-accept:hover {
    background: #005a87;
    border-color: #005a87;
    transform: translateY(-1px);
}

.cookie-consent-reject {
    background: white;
    color: var(--cookie-reject-color);
    border: 2px solid var(--cookie-reject-color);
}

.cookie-consent-reject:hover {
    background: var(--cookie-reject-color);
    color: white;
    transform: translateY(-1px);
}

.cookie-consent-settings {
    background: white;
    color: var(--cookie-banner-text);
    border: 2px solid #ddd;
}

.cookie-consent-settings:hover {
    background: #f8f9fa;
    border-color: var(--cookie-accept-color);
    color: var(--cookie-accept-color);
    transform: translateY(-1px);
}

/* Cookie Settings Modal */
.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--cookie-transition);
}

.cookie-settings-modal.show {
    opacity: 1;
    visibility: visible;
}

.cookie-settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.cookie-settings-content {
    position: relative;
    background: white;
    border: 2px solid var(--cookie-border-color);
    border-radius: var(--cookie-border-radius);
    box-shadow: var(--cookie-shadow);
    max-width: 600px;
    max-height: 80vh;
    width: 90%;
    overflow: hidden;
    transform: scale(0.8);
    transition: var(--cookie-transition);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cookie-settings-modal.show .cookie-settings-content {
    transform: scale(1);
}

/* Modal header */
.cookie-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.cookie-settings-header h3 {
    margin: 0;
    color: var(--cookie-banner-text);
    font-size: 20px;
}

.cookie-settings-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #666;
    transition: var(--cookie-transition);
}

.cookie-settings-close:hover {
    background: #e9ecef;
    color: var(--cookie-reject-color);
}

/* Modal body */
.cookie-settings-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    color: var(--cookie-banner-text);
    line-height: 1.6;
}

.cookie-settings-body > p {
    margin: 0 0 20px 0;
}

/* Cookie categories */
.cookie-category {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fafafa;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.cookie-category-header h4 {
    margin: 0;
    font-size: 16px;
    color: var(--cookie-banner-text);
}

.cookie-category-description {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Toggle switches */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: var(--cookie-transition);
    border-radius: 24px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--cookie-transition);
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: var(--cookie-accept-color);
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(26px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: var(--cookie-accept-color);
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modal footer */
.cookie-settings-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Floating cookie settings button */
.cookie-settings-float {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: var(--cookie-transition);
}

.cookie-settings-float.show {
    opacity: 1;
    visibility: visible;
}

.cookie-settings-float button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--cookie-accept-color);
    border: 3px solid white;
    box-shadow: var(--cookie-shadow);
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--cookie-transition);
}

.cookie-settings-float button:hover {
    transform: scale(1.1);
    background: #005a87;
}

/* Notification styles */
.cookie-consent-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000001;
    max-width: 400px;
    background: white;
    border-radius: var(--cookie-border-radius);
    box-shadow: var(--cookie-shadow);
    opacity: 0;
    transform: translateX(100%);
    transition: var(--cookie-transition);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cookie-consent-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.cookie-consent-notification-success {
    border: 2px solid var(--cookie-accept-color);
}

.cookie-consent-notification-error {
    border: 2px solid var(--cookie-reject-color);
}

.cookie-consent-notification-info {
    border: 2px solid #17a2b8;
}

.cookie-consent-notification-content {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cookie-consent-notification-content span {
    flex: 1;
    color: var(--cookie-banner-text);
    font-size: 14px;
}

.cookie-consent-notification-content button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: var(--cookie-transition);
}

.cookie-consent-notification-content button:hover {
    color: var(--cookie-reject-color);
}

/* Responsive design */
@media (max-width: 768px) {
    .cookie-consent-banner {
        margin: 10px;
        padding: 15px;
    }
    
    .cookie-consent-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .cookie-consent-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-consent-btn {
        flex: 1;
        min-width: auto;
    }
    
    .cookie-settings-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .cookie-settings-footer {
        flex-direction: column;
    }
    
    .cookie-settings-footer .cookie-consent-btn {
        width: 100%;
    }
    
    .cookie-settings-float {
        bottom: 20px;
        right: 20px;
        left: auto;
    }
    
    .cookie-consent-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .cookie-consent-banner.cookie-consent-center {
        top: 20px;
        bottom: 20px;
        left: 20px;
        right: 20px;
        transform: none;
        height: auto;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
    
    .cookie-consent-banner.cookie-consent-center.show {
        transform: none;
    }
    
    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-settings-float button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cookie-consent-banner,
    .cookie-settings-content,
    .cookie-consent-notification {
        border-width: 3px;
    }
    
    .cookie-consent-btn {
        border-width: 3px;
        font-weight: bold;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .cookie-settings-modal,
    .cookie-settings-float,
    .cookie-consent-notification,
    .cookie-consent-btn,
    .cookie-toggle-slider,
    .cookie-toggle-slider:before {
        transition: none;
    }
}
