/**
 * Cookie Consent Banner Styles
 * DSGVO-konformes Design
 */

/* Overlay */
.cookie-consent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-consent-overlay.show {
    opacity: 1;
}

/* Modal */
.cookie-consent-modal {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cookie-consent-overlay.show .cookie-consent-modal {
    transform: scale(1);
}

/* Header */
.cookie-consent-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-consent-logo {
    width: 40px;
    height: 40px;
}

.cookie-consent-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

/* Content */
.cookie-consent-content {
    padding: 24px;
}

.cookie-consent-description {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Categories */
.cookie-consent-categories {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cookie-category {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.cookie-category:hover {
    border-color: #d1d5db;
}

.cookie-category-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: #f9fafb;
    transition: background 0.2s ease;
}

.cookie-category-header:hover {
    background: #f3f4f6;
}

.cookie-category-name {
    flex: 1;
    font-weight: 500;
    color: #1f2937;
}

.cookie-category-status {
    font-size: 12px;
    color: #059669;
    font-weight: 500;
}

.cookie-category-header i {
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.cookie-category.expanded .cookie-category-header i {
    transform: rotate(180deg);
}

.cookie-category-content {
    padding: 0 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.cookie-category.expanded .cookie-category-content {
    padding: 16px;
    max-height: 200px;
}

.cookie-category-content p {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 24px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #3b82f6;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(20px);
}

/* Actions */
.cookie-consent-actions {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cookie-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.cookie-btn-primary {
    background: #3b82f6;
    color: white;
}

.cookie-btn-primary:hover {
    background: #2563eb;
}

.cookie-btn-secondary {
    background: #f3f4f6;
    color: #1f2937;
    border: 1px solid #d1d5db;
}

.cookie-btn-secondary:hover {
    background: #e5e7eb;
}

.cookie-btn-text {
    background: transparent;
    color: #3b82f6;
    flex: 100%;
}

.cookie-btn-text:hover {
    background: #eff6ff;
}

/* Links */
.cookie-consent-links {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.cookie-consent-links a {
    color: #6b7280;
    font-size: 13px;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.cookie-consent-links a:hover {
    color: #3b82f6;
}

/* Manage Widget (Floating Button) */
.cookie-manage-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 50px 50px 0 0;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 99999;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(80%); /* 80% versteckt, nur 20% von oben sichtbar */
}

.cookie-manage-widget.show {
    opacity: 1;
}

.cookie-manage-widget:hover {
    transform: translateY(0); /* Vollständig anzeigen beim Hover */
    background: #f9fafb;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-radius: 50px;
}

.cookie-manage-widget i {
    color: #f59e0b;
    font-size: 18px;
}

.cookie-manage-widget span {
    color: #1f2937;
    font-size: 14px;
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .cookie-consent-modal {
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
        margin-top: auto;
    }

    .cookie-consent-header {
        padding: 20px 20px 12px;
    }

    .cookie-consent-title {
        font-size: 18px;
    }

    .cookie-consent-content {
        padding: 20px;
    }

    .cookie-consent-actions {
        flex-direction: column;
        padding: 12px 20px;
    }

    .cookie-btn {
        width: 100%;
        min-width: auto;
    }

    .cookie-manage-widget {
        bottom: 15px;
        right: 15px;
        padding: 10px 16px;
        transform: translateY(80%); /* 80% versteckt */
    }

    .cookie-manage-widget:hover {
        transform: translateY(0); /* Vollständig anzeigen */
    }

    .cookie-manage-widget span {
        font-size: 13px;
    }
}

/* Accessibility */
.cookie-consent-modal:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.cookie-btn:focus,
.cookie-toggle:focus-within,
.cookie-manage-widget:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Animation */
@keyframes slideUp {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.cookie-manage-widget.show {
    animation: slideUp 0.3s ease-out;
}
