/**
 * DSGVO-konformes Cookie Consent Banner Styling
 * Entspricht den Design-Anforderungen: Gleichwertige Buttons, klare Hierarchie
 */

/* Cookie Banner (Centered Modal with Backdrop) */
.cookie-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 1rem;
    animation: fadeIn 0.4s ease-out;
}

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

.cookie-banner-content {
    background: white;
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideInScale 0.4s ease-out;
    position: relative;
}

@keyframes slideInScale {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Welcome Header */
.cookie-banner-header {
    background: linear-gradient(135deg, #1e293b, #334155);
    padding: 2rem;
    border-radius: 20px 20px 0 0;
    text-align: center;
    color: white;
}

.cookie-banner-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 800;
}

.cookie-banner-header .welcome-subtitle {
    margin: 0;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Language Selector */
.language-selector {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.language-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.language-btn.active {
    background: white;
    color: #1e293b;
    border-color: white;
}

/* Banner Body */
.cookie-banner-body {
    padding: 2rem;
}

.cookie-banner-text h3 {
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
}

.cookie-banner-text p {
    margin: 0.75rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #475569;
}

.cookie-banner-small {
    font-size: 0.85rem !important;
    color: #64748b !important;
}

/* Legal Links */
.cookie-banner-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.cookie-banner-links a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.cookie-banner-links a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.cookie-banner-links span {
    color: #cbd5e1;
    font-size: 0.85rem;
}

.cookie-banner-buttons {
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
    margin-top: 1.5rem;
}

/* Buttons - WICHTIG: Alle Buttons sind gleich groß (DSGVO-Anforderung) */
.cookie-btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.cookie-btn-accept:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.cookie-btn-reject {
    background: #f1f5f9;
    color: #1e293b;
    border: 2px solid #e2e8f0;
}

.cookie-btn-reject:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.cookie-btn-settings:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-2px);
}

/* Cookie Settings Modal */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
}

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

.cookie-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
}

.cookie-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #1e293b;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.2s;
}

.cookie-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.cookie-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.cookie-modal-intro {
    margin: 0 0 1.5rem 0;
    color: #475569;
    line-height: 1.6;
}

.cookie-category {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s;
}

.cookie-category:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.cookie-category-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.cookie-category-header h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: #1e293b;
}

.cookie-category-required {
    display: inline-block;
    background: #94a3b8;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cookie-category-badge {
    display: inline-block;
    background: #f59e0b;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cookie-category-description {
    margin: 0.75rem 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.cookie-details {
    margin: 0.75rem 0 0 0;
    padding-left: 1.25rem;
    color: #64748b;
    font-size: 0.85rem;
}

.cookie-details li {
    margin: 0.5rem 0;
}

.cookie-details a {
    color: #3b82f6;
    text-decoration: none;
}

.cookie-details a:hover {
    text-decoration: underline;
}

/* Toggle Switch */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

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

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

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

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

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

input:disabled + .cookie-slider {
    background-color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Modal Footer */
.cookie-modal-footer {
    padding: 1.5rem;
    border-top: 2px solid #e2e8f0;
    display: flex;
    gap: 0.75rem;
    background: #f8fafc;
}

.cookie-btn-primary {
    flex: 1;
    background: #10b981;
    color: white;
}

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

.cookie-btn-secondary {
    flex: 1;
    background: #64748b;
    color: white;
}

.cookie-btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 0.5rem;
    }

    .cookie-banner-content {
        border-radius: 16px;
        max-height: 95vh;
    }

    .cookie-banner-header {
        padding: 1.5rem;
        border-radius: 16px 16px 0 0;
    }

    .cookie-banner-header h2 {
        font-size: 1.5rem;
    }

    .cookie-banner-header .welcome-subtitle {
        font-size: 0.95rem;
    }

    .language-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .cookie-banner-body {
        padding: 1.5rem;
    }

    .cookie-banner-text h3 {
        font-size: 1.1rem;
    }

    .cookie-banner-text p {
        font-size: 0.9rem;
    }

    .cookie-btn {
        width: 100%;
        padding: 0.9rem 1.2rem;
        font-size: 0.95rem;
    }

    .cookie-banner-links {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .cookie-banner-links span {
        display: none;
    }

    .cookie-modal-footer {
        flex-direction: column;
    }

    .cookie-category-header {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Cookie Settings Link (für Footer) */
[data-cookie-settings] {
    cursor: pointer;
    color: inherit;
    text-decoration: underline;
}

[data-cookie-settings]:hover {
    opacity: 0.8;
}

/* Persistent Cookie Button (erscheint nach Consent) */
#cookie-persistent-button.cookie-persistent-button {
    position: fixed !important;
    left: 20px !important;
    bottom: 20px !important;
    background: linear-gradient(135deg, #1e293b, #334155) !important;
    color: white !important;
    padding: 12px 16px !important;
    border-radius: 50px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    cursor: pointer !important;
    z-index: 9998 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    animation: slideInLeft 0.5s ease-out !important;
    border: none !important;
    text-decoration: none !important;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#cookie-persistent-button.cookie-persistent-button:hover {
    transform: translateX(5px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
    background: linear-gradient(135deg, #334155, #475569) !important;
}

#cookie-persistent-button.cookie-persistent-button .cookie-icon {
    font-size: 1.25rem !important;
    animation: pulse 2s ease-in-out infinite !important;
}

#cookie-persistent-button.cookie-persistent-button .cookie-text {
    white-space: nowrap !important;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Mobile: Kleiner Button */
@media (max-width: 768px) {
    #cookie-persistent-button.cookie-persistent-button {
        left: 10px !important;
        bottom: 10px !important;
        padding: 10px 14px !important;
        font-size: 0.8rem !important;
    }

    #cookie-persistent-button.cookie-persistent-button .cookie-text {
        display: none !important;
    }

    #cookie-persistent-button.cookie-persistent-button .cookie-icon {
        font-size: 1.5rem !important;
    }
}

/* ========================================
   DARK MODE STYLES
   ======================================== */

.dark .cookie-banner-content {
    background: #1e293b;
    color: #e2e8f0;
}

.dark .cookie-banner-header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

.dark .cookie-banner-text h3 {
    color: #f1f5f9;
}

.dark .cookie-banner-text p {
    color: #cbd5e1;
}

.dark .cookie-banner-small {
    color: #94a3b8 !important;
}

.dark .cookie-banner-links {
    background: #0f172a;
    border-color: #334155;
}

.dark .cookie-banner-links a {
    color: #60a5fa;
}

.dark .cookie-banner-links a:hover {
    color: #93c5fd;
}

.dark .cookie-banner-links span {
    color: #475569;
}

.dark .cookie-btn-reject {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
}

.dark .cookie-btn-reject:hover {
    background: #475569;
}

.dark .cookie-btn-settings {
    background: transparent;
    color: #cbd5e1;
    border-color: #475569;
}

.dark .cookie-btn-settings:hover {
    background: #1e293b;
    border-color: #64748b;
}

/* Cookie Modal Dark Mode */
.dark .cookie-modal-content {
    background: #1e293b;
}

.dark .cookie-modal-header {
    background: linear-gradient(to right, #0f172a, #1e293b);
    border-bottom-color: #334155;
}

.dark .cookie-modal-header h2 {
    color: #f1f5f9;
}

.dark .cookie-modal-close {
    color: #94a3b8;
}

.dark .cookie-modal-close:hover {
    background: #334155;
    color: #f1f5f9;
}

.dark .cookie-modal-intro {
    color: #cbd5e1;
}

.dark .cookie-category {
    border-color: #334155;
    background: #0f172a;
}

.dark .cookie-category:hover {
    border-color: #475569;
    background: #1e293b;
}

.dark .cookie-category-header h4 {
    color: #f1f5f9;
}

.dark .cookie-category-description {
    color: #94a3b8;
}

.dark .cookie-details {
    color: #94a3b8;
}

.dark .cookie-details a {
    color: #60a5fa;
}

.dark .cookie-details a:hover {
    color: #93c5fd;
}

.dark .cookie-modal-footer {
    background: #0f172a;
    border-top-color: #334155;
}

.dark .cookie-slider {
    background-color: #475569;
}

.dark input:checked + .cookie-slider {
    background-color: #10b981;
}

.dark input:disabled + .cookie-slider {
    background-color: #334155;
}
