/**
 * Cookie Consent Banner Styling
 * DSGVO-konform - Light & Dark Mode
 */

#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: white;
    padding: 1.5rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    gap: 1rem;
    z-index: 9999;
    max-height: 100vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

/* Dark Mode: Heller Hintergrund */
[data-theme="dark"] #cookie-banner {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
}

@media (min-width: 768px) {
    #cookie-banner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 1.5rem 2rem;
    }
}

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

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

.cookie-banner-content {
    flex: 1;
    min-width: 0;
}

.cookie-banner-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.cookie-banner-content p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #e5e7eb;
}

.cookie-banner-content a {
    color: #10b981;
    text-decoration: none;
    font-weight: 500;
}

.cookie-banner-content a:hover {
    text-decoration: underline;
    color: #6ee7b7;
}

.cookie-banner-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    min-width: fit-content;
}

@media (max-width: 767px) {
    .cookie-banner-buttons {
        flex-direction: column;
    }
}

.cookie-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cookie-btn-accept {
    background-color: #10b981;
    color: white;
}

.cookie-btn-accept:hover {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.cookie-btn-reject {
    background-color: #6b7280;
    color: white;
}

.cookie-btn-reject:hover {
    background-color: #4b5563;
}

.cookie-btn-settings {
    background-color: transparent;
    color: #10b981;
    border: 2px solid #10b981;
}

.cookie-btn-settings:hover {
    background-color: #10b981;
    color: white;
}

/* Cookie Settings Panel */
#cookie-settings-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    padding: 2rem;
}

.cookie-settings-content {
    position: relative;
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 600px;
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
    color: #1f2937;
}

/* Dark Mode: Settings Panel */
[data-theme="dark"] .cookie-settings-content {
    background: #1f2937;
    color: #f3f4f6;
}

@media (max-width: 640px) {
    .cookie-settings-content {
        padding: 1.5rem;
        max-height: none;
        border-radius: 1rem 1rem 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: none;
    }
}

.cookie-settings-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .cookie-settings-close {
    color: #9ca3af;
}

.cookie-settings-close:hover {
    color: #1f2937;
}

[data-theme="dark"] .cookie-settings-close:hover {
    color: #f3f4f6;
}

.cookie-settings-content h2 {
    margin-top: 0;
    color: #1f2937;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

[data-theme="dark"] .cookie-settings-content h2 {
    color: #f3f4f6;
}

.cookie-settings-content p {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

[data-theme="dark"] .cookie-settings-content p {
    color: #d1d5db;
}

.cookie-category {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

[data-theme="dark"] .cookie-category {
    border-color: #374151;
    background: #111827;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.cookie-category-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 1rem;
}

[data-theme="dark"] .cookie-category-title {
    color: #f3f4f6;
}

.cookie-category-description {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .cookie-category-description {
    color: #9ca3af;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 1.5rem;
    width: 2.75rem;
    background-color: #cbd5e1;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.toggle-switch input {
    display: none;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #10b981;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(1.25rem);
}

.toggle-switch input:disabled + .toggle-slider {
    background-color: #cbd5e1;
    cursor: not-allowed;
}

.toggle-slider {
    position: absolute;
    top: 0.1875rem;
    left: 0.1875rem;
    height: 1.125rem;
    width: 1.125rem;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    pointer-events: none;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 1.125rem;
    width: 1.125rem;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

/* Cookie Settings Buttons */
.cookie-settings-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.cookie-settings-buttons button {
    flex: 1;
    min-width: 150px;
}

@media (max-width: 640px) {
    .cookie-settings-buttons {
        flex-direction: column;
    }

    .cookie-settings-buttons button {
        width: 100%;
    }
}

/* Accessibility */
#cookie-banner,
#cookie-settings-panel {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

/* Small text helper */
.cookie-small-text {
    font-size: 0.85rem;
    color: #d1d5db;
    margin: 0;
}

[data-theme="dark"] .cookie-small-text {
    color: #9ca3af;
}

@media (prefers-reduced-motion: reduce) {
    #cookie-banner,
    #cookie-settings-panel {
        animation: none !important;
    }

    .cookie-btn,
    .toggle-switch,
    .toggle-slider {
        transition: none !important;
    }
}
