/* === DSGVO Cookie-Banner Styles === */
/* Version: 1.0.0 */

/* Anpassbare CSS-Variablen für einfaches Styling */
:root {
    --banner-bg-color: #AAAAAA;
    --banner-text-color: #333333;
    --banner-link-color: #333333;
    --button-accept-bg: #28a745;
    --button-accept-text: #ffffff;
    --button-decline-bg: #dc3545;
    --button-decline-text: #ffffff;
    --button-settings-bg: #6c757d;
    --button-settings-text: #ffffff;
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --banner-border-radius: 8px;
    --banner-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --banner-max-width: 600px;
}

/* Cookie Banner Overlay */
#cookie-banner-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    z-index: 999998;
}

#cookie-banner-overlay.show {
    display: block;
}

/* Cookie Banner Container */
#cookie-banner {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: var(--banner-max-width);
    width: 90%;
    background: var(--banner-bg-color);
    color: var(--banner-text-color);
    padding: 25px;
    border-radius: var(--banner-border-radius);
    box-shadow: var(--banner-shadow);
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

#cookie-banner.show {
    display: block;
    animation: slideUp 0.3s ease-out;
}

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

#cookie-banner h2 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--banner-text-color);
}

#cookie-banner p {
    margin: 0 0 15px 0;
}

#cookie-banner a {
    color: var(--banner-link-color);
    text-decoration: underline;
}

#cookie-banner a:hover {
    text-decoration: none;
}

/* Button Container */
.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.cookie-buttons button {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.cookie-buttons button:hover {
    opacity: 0.9;
}

#cookie-accept-all {
    background: var(--button-accept-bg);
    color: var(--button-accept-text);
}

#cookie-decline-all {
    background: var(--button-decline-bg);
    color: var(--button-decline-text);
}

#cookie-settings-btn {
    background: var(--button-settings-bg);
    color: var(--button-settings-text);
}

/* Cookie Settings Modal */
#cookie-settings-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--banner-bg-color);
    color: var(--banner-text-color);
    padding: 30px;
    border-radius: var(--banner-border-radius);
    box-shadow: var(--banner-shadow);
    z-index: 1000000;
}

#cookie-settings-modal.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

#cookie-settings-modal h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
}

.cookie-category {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

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

.cookie-category h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.cookie-category p {
    margin: 10px 0 0 0;
    font-size: 13px;
    color: #666;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

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

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

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

input:checked + .toggle-slider {
    background-color: var(--button-accept-bg);
}

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

input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.settings-buttons {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.settings-buttons button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.settings-buttons button:hover {
    opacity: 0.9;
}

/* Cookie Settings Link Styling */
.cookie-settings-link {
    cursor: pointer;
    color: var(--banner-link-color);
    text-decoration: underline;
}

.cookie-settings-link:hover {
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 600px) {
    #cookie-banner {
        bottom: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }

    .cookie-buttons {
        flex-direction: column;
    }

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

    #cookie-settings-modal {
        width: 95%;
        padding: 20px;
    }
}

/* Accessibility */
#cookie-banner:focus,
#cookie-settings-modal:focus {
    outline: 2px solid var(--banner-link-color);
    outline-offset: 2px;
}

.cookie-buttons button:focus,
.settings-buttons button:focus {
    outline: 2px solid var(--banner-link-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    #cookie-banner,
    #cookie-settings-modal {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    #cookie-banner.show {
        animation: none;
    }
    
    #cookie-settings-modal.show {
        animation: none;
    }
    
    .toggle-slider,
    .toggle-slider:before {
        transition: none;
    }
}
