/**
 * NoTrack Cookie Consent Banner Styles
 *
 * Includes accessibility enhancements for WCAG compliance:
 * - High contrast text and focus indicators
 * - Keyboard navigable interface
 * - Responsive design for all devices
 * - Proper text sizing and spacing
 */

/* CSS Custom Properties with fallbacks */
:root {
    /* Banner Base Styling */
    --notrack-banner-bg: #ffffff;
    --notrack-banner-text: #333333;
    --notrack-banner-border-color: #2271b1;
    --notrack-banner-link-color: #2271b1;
    --notrack-banner-border-width: 3px;
    --notrack-banner-border-radius: 0px;
    --notrack-banner-padding: 20px;
    --notrack-banner-box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    
    /* Banner Typography */
    --notrack-banner-heading-color: #333333;
    --notrack-banner-heading-font-size: 20px;
    --notrack-banner-heading-font-weight: 600;
    --notrack-banner-text-font-size: 16px;
    --notrack-banner-link-font-weight: 500;
    
    /* Primary Button Styling */
    --notrack-primary-btn-bg: #2271b1;
    --notrack-primary-btn-text: #ffffff;
    --notrack-primary-btn-hover-bg: #135e96;
    --notrack-primary-btn-hover-text: #ffffff;
    --notrack-primary-btn-font-size: 16px;
    --notrack-primary-btn-font-weight: 500;
    --notrack-primary-btn-border-radius: 4px;
    --notrack-primary-btn-padding: 10px 15px;
    --notrack-primary-btn-box-shadow: none;
    --notrack-primary-btn-hover-box-shadow: none;
    
    /* Secondary Button Styling */
    --notrack-secondary-btn-bg: #f1f1f1;
    --notrack-secondary-btn-text: #333333;
    --notrack-secondary-btn-hover-bg: #e9e9e9;
    --notrack-secondary-btn-hover-text: #333333;
    --notrack-secondary-btn-font-size: 16px;
    --notrack-secondary-btn-font-weight: 500;
    --notrack-secondary-btn-border-radius: 4px;
    --notrack-secondary-btn-padding: 10px 15px;
    --notrack-secondary-btn-box-shadow: none;
    --notrack-secondary-btn-hover-box-shadow: none;
    
    /* Text Button Styling */
    --notrack-text-btn-bg: transparent;
    --notrack-text-btn-text: #2271b1;
    --notrack-text-btn-hover-bg: transparent;
    --notrack-text-btn-hover-text: #135e96;
    --notrack-text-btn-font-size: 16px;
    --notrack-text-btn-font-weight: 500;
    --notrack-text-btn-border-radius: 4px;
    --notrack-text-btn-padding: 10px;
    
    /* Settings Panel Styling */
    --notrack-settings-panel-bg: #ffffff;
    --notrack-settings-panel-text: #333333;
    --notrack-settings-panel-border: #dddddd;
    --notrack-settings-panel-border-radius: 4px;
    --notrack-settings-panel-padding: 20px;
    --notrack-settings-panel-box-shadow: none;
    
    /* Settings Panel Typography */
    --notrack-settings-heading-color: #333333;
    --notrack-settings-heading-font-size: 20px;
    --notrack-settings-heading-font-weight: 600;
    --notrack-settings-text-font-size: 16px;
    
    /* Cookie Category Styling */
    --notrack-category-bg: #f9f9f9;
    --notrack-category-border: #2271b1;
    --notrack-category-border-radius: 4px;
    --notrack-category-padding: 15px;
    --notrack-category-title-color: #333333;
    --notrack-category-title-font-size: 16px;
    --notrack-category-title-font-weight: 600;
    --notrack-category-description-color: #666666;
    --notrack-category-description-font-size: 14px;
    
    /* Toggle Switch Styling */
    --notrack-toggle-active-bg: #2271b1;
    --notrack-toggle-inactive-bg: #cccccc;
    --notrack-toggle-knob-color: #ffffff;
    --notrack-toggle-border-radius: 15px;
    --notrack-toggle-width: 60px;
    --notrack-toggle-height: 30px;
}

/* Banner Container */
.notrack-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--notrack-banner-bg);
    color: var(--notrack-banner-text);
    box-shadow: var(--notrack-banner-box-shadow);
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: var(--notrack-banner-text-font-size);
    line-height: 1.5;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    border-top: var(--notrack-banner-border-width) solid var(--notrack-banner-border-color);
    border-radius: var(--notrack-banner-border-radius) var(--notrack-banner-border-radius) 0 0;
    max-height: 80vh;
    overflow-y: auto;
}

/* High contrast mode */
@media (prefers-contrast: more) {
    .notrack-cookie-banner {
        background: #ffffff;
        color: #000000;
        border: 2px solid #000000;
    }
}

/* Show banner animation */
.notrack-cookie-banner.notrack-show {
    transform: translateY(0);
}

/* Banner Content */
.notrack-cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--notrack-banner-padding);
}

.notrack-cookie-banner-content,
.notrack-cookie-settings-panel {
    display: none;
}

.notrack-cookie-banner-content.notrack-show,
.notrack-cookie-settings-panel.notrack-show {
    display: block;
}

.notrack-cookie-banner-title {
    font-size: var(--notrack-banner-heading-font-size);
    font-weight: var(--notrack-banner-heading-font-weight);
    margin: 0 0 15px;
    color: var(--notrack-banner-heading-color);
}

.notrack-cookie-banner-description {
    margin: 0 0 20px;
    font-size: var(--notrack-banner-text-font-size);
    line-height: 1.6;
    color: var(--notrack-banner-text);
}

.notrack-cookie-banner-description a {
    color: var(--notrack-banner-link-color);
    font-weight: var(--notrack-banner-link-font-weight);
}

/* Buttons */
.notrack-cookie-banner-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.notrack-cookie-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--notrack-primary-btn-border-radius);
    border: 2px solid transparent;
    text-decoration: none;
    cursor: pointer;
    min-width: 120px;
    transition: all 0.2s ease;
}

.notrack-cookie-button-primary {
    background-color: var(--notrack-primary-btn-bg);
    color: var(--notrack-primary-btn-text);
    border-color: var(--notrack-primary-btn-bg);
    font-size: var(--notrack-primary-btn-font-size);
    font-weight: var(--notrack-primary-btn-font-weight);
    padding: var(--notrack-primary-btn-padding);
    box-shadow: var(--notrack-primary-btn-box-shadow);
}

.notrack-cookie-button-primary:hover,
.notrack-cookie-button-primary:focus {
    background-color: var(--notrack-primary-btn-hover-bg);
    color: var(--notrack-primary-btn-hover-text);
    border-color: var(--notrack-primary-btn-hover-bg);
    box-shadow: var(--notrack-primary-btn-hover-box-shadow);
}

.notrack-cookie-button-secondary {
    background-color: var(--notrack-secondary-btn-bg);
    color: var(--notrack-secondary-btn-text);
    border-color: var(--notrack-secondary-btn-bg);
    font-size: var(--notrack-secondary-btn-font-size);
    font-weight: var(--notrack-secondary-btn-font-weight);
    padding: var(--notrack-secondary-btn-padding);
    border-radius: var(--notrack-secondary-btn-border-radius);
    box-shadow: var(--notrack-secondary-btn-box-shadow);
}

.notrack-cookie-button-secondary:hover,
.notrack-cookie-button-secondary:focus {
    background-color: var(--notrack-secondary-btn-hover-bg);
    color: var(--notrack-secondary-btn-hover-text);
    border-color: var(--notrack-secondary-btn-hover-bg);
    box-shadow: var(--notrack-secondary-btn-hover-box-shadow);
}

.notrack-cookie-button-text {
    background-color: var(--notrack-text-btn-bg);
    color: var(--notrack-text-btn-text);
    text-decoration: underline;
    font-size: var(--notrack-text-btn-font-size);
    font-weight: var(--notrack-text-btn-font-weight);
    padding: var(--notrack-text-btn-padding);
    border-radius: var(--notrack-text-btn-border-radius);
}

.notrack-cookie-button-text:hover,
.notrack-cookie-button-text:focus {
    background-color: var(--notrack-text-btn-hover-bg);
    color: var(--notrack-text-btn-hover-text);
    text-decoration: underline;
}

/* Enhanced focus styles for accessibility */
.notrack-cookie-button:focus,
.notrack-cookie-category-toggle:focus,
.notrack-cookie-category-header:focus {
    outline: 2px solid var(--notrack-banner-link-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.5);
}

/* Settings Panel */
.notrack-cookie-settings-panel {
    background: var(--notrack-settings-panel-bg);
    color: var(--notrack-settings-panel-text);
    border-radius: var(--notrack-settings-panel-border-radius);
    padding: var(--notrack-settings-panel-padding);
    box-shadow: var(--notrack-settings-panel-box-shadow);
}

.notrack-cookie-settings-title {
    font-size: var(--notrack-settings-heading-font-size);
    font-weight: var(--notrack-settings-heading-font-weight);
    margin: 0 0 15px;
    color: var(--notrack-settings-heading-color);
}

.notrack-cookie-categories {
    margin: 20px 0;
}

.notrack-cookie-category {
    margin-bottom: 15px;
    padding: var(--notrack-category-padding);
    background-color: var(--notrack-category-bg);
    border-radius: var(--notrack-category-border-radius);
    border-left: 4px solid var(--notrack-category-border);
}

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

.notrack-cookie-category-title {
    font-weight: var(--notrack-category-title-font-weight);
    font-size: var(--notrack-category-title-font-size);
    color: var(--notrack-category-title-color);
    margin: 0;
}

.notrack-cookie-category-description {
    margin: 10px 0 0;
    font-size: var(--notrack-category-description-font-size);
    color: var(--notrack-category-description-color);
}

/* Toggle Switch */
.notrack-cookie-category-toggle-wrapper {
    position: relative;
    display: inline-block;
    width: var(--notrack-toggle-width);
    height: var(--notrack-toggle-height);
}

.notrack-cookie-category-toggle {
    opacity: 0;
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
    z-index: 2;
    cursor: pointer;
}

.notrack-cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--notrack-toggle-inactive-bg);
    transition: 0.4s;
    border-radius: var(--notrack-toggle-border-radius);
}

.notrack-cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: calc(var(--notrack-toggle-height) - 6px);
    width: calc(var(--notrack-toggle-height) - 6px);
    left: 3px;
    bottom: 3px;
    background-color: var(--notrack-toggle-knob-color);
    transition: 0.4s;
    border-radius: 50%;
}

.notrack-cookie-category-toggle:checked + .notrack-cookie-toggle-slider {
    background-color: var(--notrack-toggle-active-bg);
}

.notrack-cookie-category-toggle:checked + .notrack-cookie-toggle-slider:before {
    transform: translateX(calc(var(--notrack-toggle-width) - var(--notrack-toggle-height)));
}

/* Necessary cookies - always enabled */
.notrack-cookie-category.necessary .notrack-cookie-toggle-slider {
    background-color: var(--notrack-toggle-active-bg);
    opacity: 0.6;
    cursor: not-allowed;
}

/* Accessibility helpers */
.notrack-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.notrack-aria-live {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Responsive Design */
@media screen and (max-width: 767px) {
    .notrack-cookie-banner {
        font-size: 14px;
    }
    
    .notrack-cookie-banner-title {
        font-size: calc(var(--notrack-banner-heading-font-size) - 2px);
    }
    
    .notrack-cookie-banner-buttons {
        flex-direction: column;
    }
    
    .notrack-cookie-button {
        width: 100%;
        justify-content: center;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .notrack-cookie-banner {
        transition: none;
    }
    
    .notrack-cookie-toggle-slider:before {
        transition: none;
    }
}

/* High contrast mode enhancements */
@media (prefers-contrast: more) {
    .notrack-cookie-button-primary {
        background-color: #000000;
        color: #ffffff;
        border-color: #000000;
    }
    
    .notrack-cookie-button-secondary {
        background-color: #ffffff;
        color: #000000;
        border-color: #000000;
    }
    
    .notrack-cookie-button-text {
        color: #000000;
        text-decoration: underline;
    }
    
    .notrack-cookie-category-toggle:checked + .notrack-cookie-toggle-slider {
        background-color: #000000;
    }
    
    .notrack-cookie-category.necessary .notrack-cookie-toggle-slider {
        background-color: #000000;
    }
}

/* Print styles */
@media print {
    .notrack-cookie-banner {
        display: none;
    }
} 