/* 
 * DSGVO Consent Banner Styles für Attomic Flow
 * 2025 konform - WCAG 2.2 AA - EAA compliant
 */

/* Banner Container */
.consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

.consent-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.consent-content {
    position: relative;
    background: linear-gradient(135deg, #00143b 0%, #1a2040 100%);
    border-top: 2px solid rgba(33, 92, 201, 0.3);
    backdrop-filter: blur(12px);
    padding: 1.5rem;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 16px 16px 0 0;
}

/* Typography */
.consent-title {
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.consent-title i {
    color: #215cc9;
    font-size: 1rem;
}

.consent-description {
    color: rgba(255, 255, 255, 0.87);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
    max-width: 70ch;
}

/* Actions */
.consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.consent-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    min-height: 44px; /* WCAG touch target */
    min-width: 44px;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Primary Button (Accept All) */
.consent-btn-primary {
    background: linear-gradient(90deg, #215cc9, #4da3ff);
    color: #ffffff;
    border-color: transparent;
}

.consent-btn-primary:hover {
    background: linear-gradient(90deg, #1e54b7, #409bff);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 92, 201, 0.3);
}

.consent-btn-primary:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* Secondary Button (Decline Non-Essential) */
.consent-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
}

.consent-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.consent-btn-secondary:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* Text Button (Customize) */
.consent-btn-text {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border-color: transparent;
    text-decoration: underline;
    text-underline-offset: 4px;
    padding: 0.5rem 1rem;
}

.consent-btn-text:hover {
    color: #ffffff;
    text-decoration-color: #4da3ff;
}

.consent-btn-text:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Footer */
.consent-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.consent-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-size: 0.8125rem;
    transition: color 0.15s ease;
}

.consent-link:hover {
    color: #4da3ff;
}

.consent-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Settings Modal */
.consent-settings {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.consent-settings.show {
    opacity: 1;
    visibility: visible;
}

.consent-settings .consent-overlay {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.consent-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: linear-gradient(135deg, #00143b 0%, #1a2040 100%);
    border: 2px solid rgba(33, 92, 201, 0.3);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    backdrop-filter: blur(16px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.consent-settings.show .consent-modal {
    transform: translate(-50%, -50%) scale(1);
}

.consent-modal-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.consent-modal-title {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.consent-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.15s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.consent-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.consent-close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.consent-modal-body {
    padding: 1rem 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.consent-modal-body::-webkit-scrollbar {
    width: 6px;
}

.consent-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.consent-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.consent-category {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.consent-category:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.consent-category-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.consent-category-info {
    flex: 1;
}

.consent-category-name {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.consent-category-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0;
}

/* Toggle Switch */
.consent-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
    flex-shrink: 0;
}

.consent-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.consent-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    border-radius: 28px;
}

.consent-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    top: 2px;
    background: #ffffff;
    transition: all 0.2s ease;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.consent-switch input:checked + .consent-slider {
    background: linear-gradient(90deg, #215cc9, #4da3ff);
    border-color: #215cc9;
}

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

.consent-switch input:disabled + .consent-slider {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}

.consent-switch input:disabled + .consent-slider:before {
    background: rgba(255, 255, 255, 0.8);
}

.consent-switch:focus-within .consent-slider {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.consent-modal-footer {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
}

/* Responsive Design */
@media (max-width: 768px) {
    .consent-content {
        padding: 1.25rem;
        border-radius: 12px 12px 0 0;
    }
    
    .consent-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .consent-btn {
        width: 100%;
        justify-content: center;
    }
    
    .consent-modal {
        width: 95vw;
        max-height: 90vh;
    }
    
    .consent-category-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .consent-switch {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .consent-content {
        padding: 1rem;
    }
    
    .consent-title {
        font-size: 1rem;
    }
    
    .consent-description {
        font-size: 0.8125rem;
    }
    
    .consent-modal-header {
        padding: 1.25rem 1.25rem 0.75rem 1.25rem;
    }
    
    .consent-modal-body {
        padding: 0.75rem 1.25rem;
    }
    
    .consent-modal-footer {
        padding: 0.75rem 1.25rem 1.25rem 1.25rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .consent-content {
        border-top-width: 3px;
        border-top-color: #ffffff;
    }
    
    .consent-btn-primary {
        border: 2px solid #ffffff;
    }
    
    .consent-btn-secondary {
        border-color: #ffffff;
        background: rgba(255, 255, 255, 0.2);
    }
    
    .consent-modal {
        border-color: #ffffff;
        border-width: 3px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .consent-banner,
    .consent-settings,
    .consent-modal,
    .consent-btn,
    .consent-slider {
        transition: none;
    }
    
    .consent-btn:hover {
        transform: none;
    }
}

/* Focus Management */
.consent-banner:focus-within,
.consent-settings:focus-within {
    /* Ensure modals stay visible during focus navigation */
}

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

/* Dark mode already handled by design */
/* Light mode override if needed in future */
@media (prefers-color-scheme: light) {
    /* Future: Light mode variants if desired */
}
