/**
 * Cookie-Consent-Banner Styles
 * DSGVO-konform, Accessibility-optimiert
 * @version 1.0.0
 */

/* ============================================================================
   CONSENT BANNER
   ============================================================================ */

.consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: slideUp 0.3s ease-out;
    border-top: 3px solid #4F46E5;
}

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

.consent-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.consent-banner-header h2 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1F2937;
}

.consent-banner-body {
    margin-bottom: 20px;
}

.consent-banner-body p {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #4B5563;
}

.consent-banner-note {
    font-size: 13px !important;
    color: #6B7280 !important;
}

.consent-banner-note a {
    color: #4F46E5;
    text-decoration: underline;
    transition: color 0.2s;
}

.consent-banner-note a:hover {
    color: #4338CA;
}

.consent-banner-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.consent-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.consent-btn:focus {
    outline: 2px solid #4F46E5;
    outline-offset: 2px;
}

.consent-btn-primary {
    background: #4F46E5;
    color: white;
}

.consent-btn-primary:hover {
    background: #4338CA;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.consent-btn-secondary {
    background: #F3F4F6;
    color: #1F2937;
}

.consent-btn-secondary:hover {
    background: #E5E7EB;
}

.consent-btn-text {
    background: transparent;
    color: #4F46E5;
    padding: 12px 16px;
}

.consent-btn-text:hover {
    background: #F3F4F6;
}

/* ============================================================================
   SETTINGS MODAL
   ============================================================================ */

.consent-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
    padding: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.consent-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.2s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.consent-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #E5E7EB;
}

.consent-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1F2937;
}

.consent-modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #6B7280;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
}

.consent-modal-close:hover {
    color: #1F2937;
}

.consent-modal-close:focus {
    outline: 2px solid #4F46E5;
    outline-offset: 2px;
    border-radius: 4px;
}

.consent-modal-body {
    padding: 24px;
}

.consent-category {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #E5E7EB;
}

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

.consent-category-disabled {
    opacity: 0.6;
}

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

.consent-category-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
}

.consent-category-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #6B7280;
}

.consent-modal-footer {
    padding: 16px 24px 24px 24px;
    display: flex;
    gap: 12px;
    border-top: 1px solid #E5E7EB;
}

/* ============================================================================
   TOGGLE SWITCH
   ============================================================================ */

.consent-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

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

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

.consent-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.consent-toggle input:checked + .consent-toggle-slider {
    background-color: #4F46E5;
}

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

.consent-toggle input:focus + .consent-toggle-slider {
    box-shadow: 0 0 0 2px #4F46E5;
}

.consent-toggle-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.consent-toggle-disabled .consent-toggle-slider {
    cursor: not-allowed;
}

/* ============================================================================
   SETTINGS BUTTON (nach Consent)
   ============================================================================ */

.consent-settings-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: 2px solid #E5E7EB;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    z-index: 9998;
}

.consent-settings-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    border-color: #4F46E5;
}

.consent-settings-button:focus {
    outline: 2px solid #4F46E5;
    outline-offset: 2px;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .consent-banner-content {
        padding: 20px;
    }
    
    .consent-banner-header h2 {
        font-size: 18px;
    }
    
    .consent-banner-actions {
        flex-direction: column;
    }
    
    .consent-btn {
        width: 100%;
        text-align: center;
    }
    
    .consent-modal-content {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .consent-modal-footer {
        flex-direction: column;
    }
    
    .consent-modal-footer .consent-btn {
        width: 100%;
    }
    
    .consent-settings-button {
        bottom: 16px;
        left: 16px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .consent-banner {
        border-top-width: 4px;
    }
    
    .consent-btn-primary {
        background: #000;
    }
    
    .consent-btn-secondary {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .consent-banner,
    .consent-modal,
    .consent-modal-content,
    .consent-btn,
    .consent-toggle-slider,
    .consent-toggle-slider:before {
        animation: none;
        transition: none;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    .consent-banner {
        background: #1F2937;
        border-top-color: #6366F1;
    }
    
    .consent-banner-header h2 {
        color: #F9FAFB;
    }
    
    .consent-banner-body p {
        color: #D1D5DB;
    }
    
    .consent-banner-note {
        color: #9CA3AF !important;
    }
    
    .consent-btn-secondary {
        background: #374151;
        color: #F9FAFB;
    }
    
    .consent-btn-secondary:hover {
        background: #4B5563;
    }
    
    .consent-modal-content {
        background: #1F2937;
    }
    
    .consent-modal-header {
        border-bottom-color: #374151;
    }
    
    .consent-modal-header h2 {
        color: #F9FAFB;
    }
    
    .consent-modal-close {
        color: #9CA3AF;
    }
    
    .consent-modal-close:hover {
        color: #F9FAFB;
    }
    
    .consent-category {
        border-bottom-color: #374151;
    }
    
    .consent-category-header h3 {
        color: #F9FAFB;
    }
    
    .consent-category-description {
        color: #D1D5DB;
    }
    
    .consent-modal-footer {
        border-top-color: #374151;
    }
    
    .consent-settings-button {
        background: #1F2937;
        border-color: #374151;
    }
}

/* ============================================================================
   PRINT
   ============================================================================ */

@media print {
    .consent-banner,
    .consent-modal,
    .consent-settings-button {
        display: none !important;
    }
}
