/**
 * Cookie Consent Management System - Styles
 * DSGVO/TTDSG-konformes Design ohne Dark Patterns
 */

/* Banner Overlay */
.cookie-consent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-consent-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Banner Container */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.cookie-consent-container {
    background-color: #ffffff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Banner Header */
.cookie-consent-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.cookie-consent-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-consent-title svg {
    width: 24px;
    height: 24px;
    color: #2563eb;
}

.cookie-consent-description {
    color: #4b5563;
    margin: 0;
}

/* Button Container - Gleichwertige Darstellung! */
.cookie-consent-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 24px;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

/* Alle Hauptbuttons gleich groß und gleichwertig */
.cookie-consent-btn {
    flex: 1;
    min-width: 180px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    border: 2px solid transparent;
}

/* Akzeptieren Button - NICHT übermäßig hervorgehoben */
.cookie-consent-btn-accept {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.cookie-consent-btn-accept:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

/* Ablehnen Button - GLEICHWERTIG zum Akzeptieren */
.cookie-consent-btn-reject {
    background-color: #ffffff;
    color: #374151;
    border-color: #374151;
}

.cookie-consent-btn-reject:hover {
    background-color: #f3f4f6;
    border-color: #1f2937;
}

/* Einstellungen Button */
.cookie-consent-btn-settings {
    background-color: transparent;
    color: #2563eb;
    border-color: #2563eb;
}

.cookie-consent-btn-settings:hover {
    background-color: #eff6ff;
}

/* Details/Modal View */
.cookie-consent-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    z-index: 100000;
    display: none;
}

.cookie-consent-modal.visible {
    display: block;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.cookie-consent-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-consent-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.cookie-consent-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.cookie-consent-modal-close:hover {
    color: #1f2937;
}

.cookie-consent-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 180px);
}

.cookie-consent-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Kategorie-Abschnitte */
.cookie-consent-category {
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.cookie-consent-category:last-child {
    margin-bottom: 0;
}

.cookie-consent-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: #f9fafb;
    cursor: pointer;
    user-select: none;
}

.cookie-consent-category-header:hover {
    background-color: #f3f4f6;
}

.cookie-consent-category-info {
    flex: 1;
}

.cookie-consent-category-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-consent-category-name .essential-badge {
    font-size: 11px;
    font-weight: 500;
    background-color: #dbeafe;
    color: #1e40af;
    padding: 2px 8px;
    border-radius: 4px;
}

.cookie-consent-category-desc {
    font-size: 13px;
    color: #6b7280;
}

/* Toggle Switch */
.cookie-consent-toggle {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
    margin-left: 16px;
}

.cookie-consent-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-consent-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 28px;
}

.cookie-consent-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    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-consent-toggle input:checked + .cookie-consent-toggle-slider {
    background-color: #2563eb;
}

.cookie-consent-toggle input:checked + .cookie-consent-toggle-slider:before {
    transform: translateX(24px);
}

.cookie-consent-toggle input:disabled + .cookie-consent-toggle-slider {
    background-color: #9ca3af;
    cursor: not-allowed;
}

/* Service Details */
.cookie-consent-services {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    display: none;
}

.cookie-consent-services.expanded {
    display: block;
}

.cookie-consent-service {
    padding: 12px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
}

.cookie-consent-service:last-child {
    margin-bottom: 0;
}

.cookie-consent-service-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.cookie-consent-service-provider {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

.cookie-consent-service-details {
    font-size: 13px;
    color: #4b5563;
}

.cookie-consent-service-details p {
    margin: 4px 0;
}

.cookie-consent-service-details strong {
    color: #374151;
}

.cookie-consent-service-details a {
    color: #2563eb;
    text-decoration: none;
}

.cookie-consent-service-details a:hover {
    text-decoration: underline;
}

/* Expand/Collapse Icon */
.cookie-consent-expand-icon {
    width: 20px;
    height: 20px;
    color: #6b7280;
    transition: transform 0.2s;
    margin-right: 12px;
}

.cookie-consent-category.expanded .cookie-consent-expand-icon {
    transform: rotate(180deg);
}

/* Links im Banner */
.cookie-consent-links {
    padding: 12px 24px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.cookie-consent-links a {
    color: #2563eb;
    text-decoration: none;
    margin: 0 12px;
}

.cookie-consent-links a:hover {
    text-decoration: underline;
}

/* Footer Trigger Button */
.cookie-settings-trigger {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #9ca3af;
    transition: color 0.2s;
}

.cookie-settings-trigger:hover {
    color: #ffffff;
}

.cookie-settings-trigger svg {
    width: 16px;
    height: 16px;
}

/* Responsive Design */
@media (max-width: 640px) {
    .cookie-consent-container {
        max-height: 70vh;
        display: flex;
        flex-direction: column;
    }
    
    .cookie-consent-header {
        padding: 12px 16px 10px;
        flex-shrink: 0;
        overflow-y: auto;
        max-height: 25vh;
    }
    
    .cookie-consent-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .cookie-consent-title svg {
        width: 20px;
        height: 20px;
    }
    
    .cookie-consent-description {
        font-size: 12px;
        line-height: 1.4;
    }
    
    /* Scrollbarer Bereich für Kategorien */
    .cookie-consent-categories {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
    
    .cookie-consent-buttons {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        padding: 12px 16px;
        flex-shrink: 0;
        background-color: #f9fafb;
        gap: 8px;
    }
    
    .cookie-consent-btn {
        width: 100%;
        min-width: unset;
        flex: none;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    /* MODAL Mobile Styles - WICHTIG */
    .cookie-consent-modal {
        width: 95%;
        max-height: 85vh;
        top: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        flex-direction: column;
    }
    
    .cookie-consent-modal.visible {
        display: flex;
    }
    
    .cookie-consent-modal-header {
        padding: 12px 16px;
        flex-shrink: 0;
    }
    
    .cookie-consent-modal-title {
        font-size: 16px;
    }
    
    .cookie-consent-tabs {
        padding: 0 12px;
        flex-shrink: 0;
    }
    
    .cookie-consent-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .cookie-consent-modal-body {
        flex: 1;
        overflow-y: auto;
        padding: 12px 16px;
        max-height: none;
        min-height: 0;
    }
    
    .cookie-consent-modal-footer {
        flex-direction: column;
        gap: 8px;
        padding: 12px 16px;
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
        background-color: #f9fafb;
        border-top: 1px solid #e5e7eb;
    }
    
    .cookie-consent-modal-footer .cookie-consent-btn {
        width: 100%;
        padding: 10px 14px;
        font-size: 13px;
    }
    
    /* Kategorien im Modal kompakter */
    .cookie-consent-category {
        margin-bottom: 12px;
    }
    
    .cookie-consent-category-header {
        flex-wrap: wrap;
        padding: 10px 12px;
    }
    
    .cookie-consent-category-name {
        font-size: 13px;
    }
    
    .cookie-consent-category-desc {
        font-size: 11px;
        line-height: 1.3;
    }
    
    .cookie-consent-toggle {
        margin-top: 8px;
        margin-left: 0;
        width: 44px;
        height: 24px;
    }
    
    .cookie-consent-toggle-slider:before {
        height: 18px;
        width: 18px;
    }
    
    .cookie-consent-toggle input:checked + .cookie-consent-toggle-slider:before {
        transform: translateX(20px);
    }
    
    .cookie-consent-links {
        padding: 8px 16px;
        font-size: 11px;
        flex-shrink: 0;
    }
    
    .cookie-consent-links a {
        margin: 0 8px;
    }
    
    .cookie-consent-legal {
        padding: 10px 16px;
        font-size: 10px;
        flex-shrink: 0;
    }
}

/* Extra kleine Bildschirme (iPhone SE, iPhone 12, etc.) */
@media (max-width: 430px) {
    .cookie-consent-container {
        max-height: 65vh;
    }
    
    .cookie-consent-header {
        padding: 10px 14px 8px;
        max-height: 20vh;
    }
    
    .cookie-consent-title {
        font-size: 15px;
        margin-bottom: 6px;
        gap: 8px;
    }
    
    .cookie-consent-title svg {
        width: 18px;
        height: 18px;
    }
    
    .cookie-consent-description {
        font-size: 11px;
        line-height: 1.3;
    }
    
    .cookie-consent-buttons {
        padding: 10px 14px;
        gap: 6px;
    }
    
    .cookie-consent-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    /* Modal für kleine Screens */
    .cookie-consent-modal {
        max-height: 80vh;
        border-radius: 12px;
    }
    
    .cookie-consent-modal-header {
        padding: 10px 14px;
    }
    
    .cookie-consent-modal-title {
        font-size: 15px;
    }
    
    .cookie-consent-modal-body {
        padding: 10px 14px;
    }
    
    .cookie-consent-modal-footer {
        padding: 10px 14px;
        gap: 6px;
    }
    
    .cookie-consent-modal-footer .cookie-consent-btn {
        padding: 9px 12px;
        font-size: 12px;
    }
    
    .cookie-consent-category {
        margin-bottom: 8px;
    }
    
    .cookie-consent-category-header {
        padding: 8px 10px;
    }
    
    .cookie-consent-category-name {
        font-size: 12px;
    }
    
    .cookie-consent-category-desc {
        font-size: 10px;
    }
    
    .cookie-consent-links {
        padding: 6px 14px;
        font-size: 10px;
    }
    
    .cookie-consent-links a {
        margin: 0 6px;
    }
    
    .cookie-consent-legal {
        padding: 8px 14px;
        font-size: 9px;
    }
}

/* Animation für das Banner */
.cookie-consent-container {
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.cookie-consent-banner.visible .cookie-consent-container {
    transform: translateY(0);
}

/* Rechtliche Hinweise */
.cookie-consent-legal {
    padding: 16px 24px;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
    color: #6b7280;
}

.cookie-consent-legal strong {
    color: #374151;
}

/* Tab Navigation für Modal */
.cookie-consent-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 24px;
}

.cookie-consent-tab {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.cookie-consent-tab:hover {
    color: #2563eb;
}

.cookie-consent-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.cookie-consent-tab-content {
    display: none;
}

.cookie-consent-tab-content.active {
    display: block;
}

/* Verantwortlicher Info */
.cookie-consent-responsible {
    background-color: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.cookie-consent-responsible h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.cookie-consent-responsible p {
    font-size: 13px;
    color: #4b5563;
    margin: 0;
}

/* Print Styles */
@media print {
    .cookie-consent-banner,
    .cookie-consent-overlay,
    .cookie-consent-modal {
        display: none !important;
    }
}
