/**
 * Cookie Consent Banner Styles
 * GDPR compliant cookie consent banner with modern design
 */

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    font-family: 'Inter', Arial, sans-serif;
    max-height: 90vh;
    overflow-y: auto;
}

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

.cookie-consent-banner.hide {
    transform: translateY(100%);
}

.cookie-consent-content {
    padding: 20px;
    max-width: 1200px;
    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 h3 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-consent-text p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #666;
}

.cookie-consent-text a {
    color: #4a6cf7;
    text-decoration: none;
    font-weight: 500;
}

.cookie-consent-text a:hover {
    text-decoration: underline;
}

.cookie-consent-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
}

.cookie-btn:focus {
    outline: 2px solid #4a6cf7;
    outline-offset: 2px;
}

.cookie-btn-primary {
    background: #4a6cf7;
    color: white;
}

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

.cookie-btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.cookie-btn-secondary:hover {
    background: #e9ecef;
    color: #495057;
}

.cookie-btn-settings {
    background: transparent;
    color: #4a6cf7;
    border: 1px solid #4a6cf7;
}

.cookie-btn-settings:hover {
    background: #4a6cf7;
    color: white;
}

/* Cookie Settings Panel */
.cookie-settings-panel {
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.cookie-settings-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.cookie-settings-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.cookie-close-settings {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.cookie-close-settings:hover {
    background: #f0f0f0;
    color: #666;
}

.cookie-settings-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.cookie-category {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.cookie-category:last-child {
    margin-bottom: 0;
}

.cookie-category-header {
    margin-bottom: 8px;
}

.cookie-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 1rem;
}

.cookie-toggle input[type="checkbox"] {
    display: none;
}

.cookie-toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input[type="checkbox"]:checked + .cookie-toggle-slider {
    background: #4a6cf7;
}

.cookie-toggle input[type="checkbox"]:checked + .cookie-toggle-slider::before {
    transform: translateX(26px);
}

.cookie-toggle input[type="checkbox"]:disabled + .cookie-toggle-slider {
    background: #28a745;
    opacity: 0.7;
}

.cookie-toggle input[type="checkbox"]:disabled + .cookie-toggle-slider::before {
    transform: translateX(26px);
}

.cookie-category-description {
    margin: 8px 0 0 62px;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.cookie-settings-actions {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    background: white;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 15px;
    }
    
    .cookie-consent-text {
        min-width: auto;
        text-align: center;
    }
    
    .cookie-consent-actions {
        justify-content: center;
        gap: 8px;
    }
    
    .cookie-btn {
        flex: 1;
        min-width: auto;
        padding: 12px 16px;
        font-size: 0.85rem;
    }
    
    .cookie-settings-content {
        padding: 15px;
    }
    
    .cookie-category {
        padding: 12px;
    }
    
    .cookie-category-description {
        margin-left: 0;
        margin-top: 12px;
    }
    
    .cookie-toggle {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .cookie-consent-banner {
        max-height: 95vh;
    }
    
    .cookie-consent-content {
        padding: 12px;
    }
    
    .cookie-consent-text h3 {
        font-size: 1.1rem;
    }
    
    .cookie-consent-text p {
        font-size: 0.9rem;
    }
    
    .cookie-consent-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .cookie-btn {
        width: 100%;
        padding: 14px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cookie-consent-banner {
        border-top: 2px solid #000;
    }
    
    .cookie-btn-primary {
        background: #000;
        border: 2px solid #000;
    }
    
    .cookie-btn-secondary {
        border: 2px solid #666;
    }
    
    .cookie-toggle-slider {
        border: 2px solid #666;
    }
}

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

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

/* Focus styles for accessibility */
.cookie-toggle:focus-within .cookie-toggle-slider {
    outline: 2px solid #4a6cf7;
    outline-offset: 2px;
}

/* Loading state */
.cookie-consent-banner.loading {
    pointer-events: none;
    opacity: 0.7;
}

.cookie-consent-banner.loading .cookie-btn {
    cursor: not-allowed;
}

/* Success state */
.cookie-consent-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    z-index: 10001;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s;
    animation-fill-mode: forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}