/**
 * Cookie Consent Banner Styles
 * Modern, responsive design for cookie consent popup
 */

/* Cookie Banner Base */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-top: 3px solid #007bff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    padding: 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.cookie-consent-banner.cookie-banner-visible {
    transform: translateY(0);
}

/* Banner Content Layout */
.cookie-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 24px;
}

.cookie-banner-text {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.cookie-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    color: #007bff;
}

.cookie-icon svg {
    width: 100%;
    height: 100%;
}

.cookie-message h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
}

.cookie-message p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
    line-height: 1.4;
    max-width: 500px;
}

/* Button Actions */
.cookie-banner-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    align-items: center;
}

.cookie-btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cookie-btn-primary {
    background: #007bff;
    color: white;
}

.cookie-btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.cookie-btn-secondary {
    background: #6c757d;
    color: white;
}

.cookie-btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}

.cookie-btn-tertiary {
    background: transparent;
    color: #6c757d;
    border: 2px solid #dee2e6;
}

.cookie-btn-tertiary:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

/* Customize Content Layout */
.cookie-customize-content {
    flex-direction: column;
    align-items: stretch;
    padding: 24px;
    gap: 20px;
}

.cookie-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #dee2e6;
}

.cookie-banner-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #212529;
}

.cookie-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6c757d;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cookie-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.cookie-close svg {
    width: 20px;
    height: 20px;
}

/* Cookie Preferences */
.cookie-preferences {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cookie-category {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

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

.cookie-category h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
}

.cookie-category p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
    line-height: 1.4;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    cursor: pointer;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .cookie-slider {
    background-color: #007bff;
}

.cookie-toggle input:checked + .cookie-slider:before {
    transform: translateX(24px);
}

.cookie-toggle input:disabled + .cookie-slider {
    background-color: #28a745;
    opacity: 0.7;
    cursor: not-allowed;
}

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

/* Body overlay when banner is active */
body.cookie-banner-active {
    overflow-x: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px;
    }
    
    .cookie-banner-text {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }
    
    .cookie-banner-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .cookie-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-message h3 {
        font-size: 16px;
    }
    
    .cookie-message p {
        font-size: 13px;
        max-width: none;
    }
    
    .cookie-customize-content {
        padding: 16px;
    }
    
    .cookie-category {
        padding: 12px;
    }
    
    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .cookie-banner-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .cookie-close {
        align-self: flex-end;
    }
    
    .cookie-icon {
        width: 28px;
        height: 28px;
    }
    
    .cookie-message h3 {
        font-size: 15px;
    }
    
    .cookie-message p {
        font-size: 12px;
    }
    
    .cookie-btn {
        padding: 12px 16px;
        font-size: 13px;
    }
}

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

.cookie-consent-banner.cookie-banner-visible {
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus styles for accessibility */
.cookie-btn:focus,
.cookie-close:focus,
.cookie-toggle:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cookie-consent-banner {
        border-top-width: 4px;
        box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.3);
    }
    
    .cookie-btn {
        border: 2px solid currentColor;
    }
    
    .cookie-category {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .cookie-btn,
    .cookie-slider,
    .cookie-slider:before {
        transition: none;
    }
    
    .cookie-consent-banner.cookie-banner-visible {
        animation: none;
    }
}
