/**
 * Modern Cookie Consent Banner Styles
 * Responsive, customizable, and accessible
 */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --background-color: #ffffff;
    --text-color: #333333;
    --border-color: #e9ecef;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Main Banner Container */
.cookie-consent-banner {
    position: fixed;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

/* Positioning Classes */
.cookie-consent-banner.position-bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
}

.cookie-consent-banner.position-bottom.show {
    transform: translateX(-50%) translateY(0);
}

.cookie-consent-banner.position-top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
}

.cookie-consent-banner.position-top.show {
    transform: translateX(-50%) translateY(0);
}

.cookie-consent-banner.position-left {
    left: 20px;
    top: 50%;
    transform: translateY(-50%) translateX(-20px);
}

.cookie-consent-banner.position-left.show {
    transform: translateY(-50%) translateX(0);
}

.cookie-consent-banner.position-right {
    right: 20px;
    top: 50%;
    transform: translateY(-50%) translateX(20px);
}

.cookie-consent-banner.position-right.show {
    transform: translateY(-50%) translateX(0);
}

.cookie-consent-banner.position-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
}

.cookie-consent-banner.position-center.show {
    transform: translate(-50%, -50%) scale(1);
}

/* Theme Variations */
.cookie-consent-banner.theme-dark {
    --background-color: #2d3748;
    --text-color: #ffffff;
    --border-color: #4a5568;
}

.cookie-consent-banner.theme-dark .btn-outline {
    border-color: #ffffff;
    color: #ffffff;
}

.cookie-consent-banner.theme-dark .btn-outline:hover {
    background-color: #ffffff;
    color: #2d3748;
}

/* Banner Content */
.cookie-banner-content {
    padding: 24px;
}

.cookie-banner-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.cookie-banner-description {
    margin: 0 0 20px 0;
    color: var(--text-color);
    opacity: 0.8;
}

/* Buttons */
.cookie-banner-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: color-mix(in srgb, var(--primary-color) 85%, black);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: color-mix(in srgb, var(--secondary-color) 85%, black);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background-color: var(--border-color);
}

.btn-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: var(--text-color);
    transition: var(--transition);
}

.btn-close:hover {
    background-color: var(--border-color);
}

/* Settings Panel */
.cookie-settings-panel {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 20px;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.settings-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.settings-description {
    margin: 0 0 20px 0;
    color: var(--text-color);
    opacity: 0.8;
    font-size: 13px;
}

/* Cookie Categories */
.cookie-categories {
    margin-bottom: 20px;
}

.cookie-category {
    margin-bottom: 20px;
    padding: 16px;
    background-color: color-mix(in srgb, var(--background-color) 95%, var(--border-color));
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

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

.category-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.category-description {
    margin: 0;
    font-size: 13px;
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.4;
}

.always-active {
    font-size: 12px;
    color: var(--success-color);
    font-weight: 500;
    background-color: color-mix(in srgb, var(--success-color) 10%, transparent);
    padding: 4px 8px;
    border-radius: 4px;
}

/* GDPR Switcher */
.gdpr-dialog-switcher {
    width: 44px;
    height: 24px;
    background-color: #ccc;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.gdpr-dialog-switcher:focus {
    outline: none;
    border-color: var(--primary-color);
}

.gdpr-dialog-switcher.switcher-on {
    background-color: var(--primary-color);
}

.switcher-handle {
    width: 18px;
    height: 18px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 1px;
    left: 1px;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.gdpr-dialog-switcher.switcher-on .switcher-handle {
    transform: translateX(20px);
}

/* Settings Footer */
.settings-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.privacy-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.privacy-link:hover {
    text-decoration: underline;
}

/* Floating Cookie Button */
.cookie-settings-float {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 9999;
}

.cookie-settings-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.cookie-settings-float img {
    width: 24px;
    height: 24px;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-consent-banner {
        width: 95%;
        max-width: none;
    }
    
    .cookie-consent-banner.position-left,
    .cookie-consent-banner.position-right {
        left: 50%;
        right: auto;
        top: auto;
        bottom: 20px;
        transform: translateX(-50%) translateY(20px);
    }
    
    .cookie-consent-banner.position-left.show,
    .cookie-consent-banner.position-right.show {
        transform: translateX(-50%) translateY(0);
    }
    
    .cookie-banner-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
        min-width: auto;
    }
    
    .settings-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-banner-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .cookie-consent-banner {
        width: 100%;
        border-radius: 0;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        transform: translateY(100%) !important;
    }
    
    .cookie-consent-banner.show {
        transform: translateY(0) !important;
    }
    
    .cookie-settings-float {
        bottom: 10px;
        left: 10px;
        width: 45px;
        height: 45px;
    }
    
    .cookie-settings-float img {
        width: 20px;
        height: 20px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .btn,
    .gdpr-dialog-switcher,
    .switcher-handle,
    .cookie-settings-float {
        transition: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .cookie-consent-banner {
        border-width: 2px;
    }
    
    .btn {
        border-width: 2px;
    }
    
    .gdpr-dialog-switcher {
        border-width: 2px;
    }
}

/* Print styles */
@media print {
    .cookie-consent-banner,
    .cookie-settings-float {
        display: none !important;
    }
}
