/**
 * Cookie Consent Banner CSS
 * 
 * Separate CSS-Datei für bessere Modularität und Performance.
 * Diese Datei kann auch minifiziert werden für Produktionsumgebungen.
 */

/* Banner Styles */
.consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #e0e0e0;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: slideUp 0.3s ease-out;
}

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

.consent-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.consent-banner-text {
    flex: 1;
}

.consent-banner-text h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.consent-banner-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #666;
}

.consent-banner-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Button Styles */
.consent-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.consent-btn-minimal {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.consent-btn-minimal:hover {
    background: #e9e9e9;
}

.consent-btn-settings {
    background: #007cba;
    color: white;
}

.consent-btn-settings:hover {
    background: #005a87;
}

.consent-btn-accept {
    background: #28a745;
    color: white;
}

.consent-btn-accept:hover {
    background: #218838;
}

.consent-btn-primary {
    background: #007cba;
    color: white;
}

.consent-btn-primary:hover {
    background: #005a87;
}

/* Modal Styles */
.consent-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.consent-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.consent-modal-content {
    position: relative;
    background: white;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    margin: 5vh auto;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

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

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

.consent-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

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

.consent-modal-body {
    padding: 20px 30px;
    overflow-y: auto;
    flex: 1;
}

.consent-intro {
    margin-bottom: 25px;
}

.consent-intro p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

/* Category Styles */
.consent-category {
    margin-bottom: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.consent-category-header {
    background: #f8f9fa;
    padding: 15px 20px;
}

.consent-category-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.consent-category-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.consent-toggle-wrapper {
    display: flex;
    align-items: center;
}

/* Toggle Switch Styles */
.consent-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    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: #ccc;
    transition: 0.2s;
    border-radius: 24px;
}

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

.consent-toggle input:checked + .consent-toggle-slider {
    background-color: #28a745;
}

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

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

.consent-always-active {
    font-size: 12px;
    color: #28a745;
    font-weight: 500;
}

/* Service Details */
.consent-category-description {
    padding: 0 20px 15px;
}

.consent-service {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

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

.consent-service-header {
    margin-bottom: 8px;
}

.consent-service-urls {
    margin-top: 5px;
}

.consent-service-url {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-right: 5px;
    margin-top: 2px;
}

.consent-service-description {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Modal Footer */
.consent-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Accessibility */
.consent-btn:focus,
.consent-toggle input:focus + .consent-toggle-slider,
.consent-modal-close:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.consent-banner[aria-hidden="true"] {
    display: none !important;
}

.consent-modal[aria-hidden="true"] {
    display: none !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .consent-banner {
        border-top: 2px solid #000;
    }
    
    .consent-btn {
        border: 2px solid currentColor;
    }
    
    .consent-modal-content {
        border: 2px solid #000;
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .consent-banner-content {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .consent-banner-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .consent-modal-content {
        width: 95%;
        margin: 2.5vh auto;
        max-height: 95vh;
        display: flex;
        flex-direction: column;
    }
    
    .consent-modal-header,
    .consent-modal-body,
    .consent-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .consent-modal-body {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 10px;
    }
    
    .consent-category-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .consent-modal-footer {
        flex-direction: column;
        flex-shrink: 0; /* Footer immer sichtbar */
        gap: 8px;
        padding-top: 15px;
        padding-bottom: 20px;
        background: white;
        border-top: 1px solid #e0e0e0;
    }
    
    .consent-modal-footer .consent-btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .consent-banner {
        position: fixed;
        bottom: 0; /* Zurück nach unten für bessere UX */
        top: auto;
        left: 0;
        right: 0;
        max-height: 75vh; /* Weniger Platz einnehmen */
        overflow-y: auto;
        padding: 12px;
        z-index: 99999;
    }
    
    .consent-banner-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 0;
    }
    
    .consent-banner-text {
        font-size: 14px;
        line-height: 1.4;
        text-align: center;
        margin: 0;
        padding: 0 8px;
    }
    
    .consent-banner-buttons {
        flex-direction: column;
        gap: 8px;
        margin: 0;        
    }
    
    .consent-btn {
        width: 100%;
        padding: 14px 16px;
        font-size: 15px;
        font-weight: 600;
        border-radius: 6px;
        border: none;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    /* Wichtigster Button hervorheben */
    .consent-btn-accept {
        background: #4CAF50 !important;
        color: white !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        padding: 16px !important;
        box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    }
    
    .consent-btn-minimal {
        background: #f5f5f5 !important;
        color: #666 !important;
    }
    
    .consent-btn-settings {
        background: #2196F3 !important;
        color: white !important;
    }
    
    .consent-modal-content {
        width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .consent-modal-body {
        flex: 1 !important;
        overflow-y: auto !important;
        padding-bottom: 10px !important;
    }
    
    .consent-modal-footer {
        flex-shrink: 0 !important; /* Footer IMMER sichtbar */
        position: sticky !important;
        bottom: 0 !important;
        background: white !important;
        border-top: 2px solid #e0e0e0 !important;
        padding: 15px !important;
        gap: 10px !important;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
    }
    
    .consent-modal-footer .consent-btn {
        width: 100% !important;
        padding: 14px 16px !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        border-radius: 6px !important;
        margin: 0 !important;
    }
    
    /* Wichtigster Button im Modal hervorheben */
    .consent-modal-footer .consent-btn-accept {
        background: #4CAF50 !important;
        color: white !important;
        font-weight: 700 !important;
        order: -1 !important; /* Nach oben */
    }
    
    .consent-modal-footer .consent-btn-primary {
        background: #2196F3 !important;
        color: white !important;
    }
    
    .consent-modal-footer .consent-btn-minimal {
        background: #f5f5f5 !important;
        color: #666 !important;
    }
}

/* Extra kleine Bildschirme (unter 400px) */
@media (max-width: 400px) {
    .consent-banner {
        max-height: 80vh;
        padding: 12px;
    }
    
    .consent-banner-content {
        font-size: 13px;
        line-height: 1.3;
    }
    
    .consent-banner-text {
        margin-bottom: 12px;
    }
    
    .consent-banner-buttons {
        gap: 6px;
    }
    
    .consent-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .consent-btn-accept {
        font-size: 15px !important;
    }
}

/* Hochauflösende Geräte wie Pixel 9 */
@media (max-width: 480px) and (-webkit-device-pixel-ratio: 2.5), 
       (max-width: 480px) and (min-device-pixel-ratio: 2.5) {
    .consent-banner {
        max-height: 70vh !important;
        padding: 10px !important;
    }
    
    .consent-banner-text {
        font-size: 13px !important;
        line-height: 1.3 !important;
    }
    
    .consent-btn {
        padding: 12px 14px !important;
        font-size: 14px !important;
    }
    
    .consent-btn-accept {
        padding: 14px 16px !important;
        font-size: 15px !important;
    }
}

/* Sehr hohe Bildschirme - Banner unten lassen */
@media (min-height: 800px) and (max-width: 480px) {
    .consent-banner {
        position: fixed;
        top: auto;
        bottom: 0;
        max-height: 60vh;
    }
}

/* Video Placeholder Styling - Gemeinsam für YouTube und Vimeo */
.consent-youtube-placeholder,
.consent-vimeo-placeholder {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: unset !important;
}

/* Bootstrap embed-responsive Kompatibilität */
.embed-responsive .consent-youtube-placeholder,
.embed-responsive .consent-vimeo-placeholder {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 2;
}

.consent-youtube-placeholder:hover,
.consent-vimeo-placeholder:hover {
    transform: none; /* Kein Scale in responsive Container */
}

/* YouTube-spezifische Button-Farbe */
.consent-youtube-placeholder button:hover {
    background: #cc0000 !important;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* Vimeo-spezifische Button-Farbe */
.consent-vimeo-placeholder button:hover {
    background: #0f1419 !important;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

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