/* ============================================
   Cookie Consent Banner & Settings Modal
   DSGVO/GDPR konform - Mobile First
   ============================================ */

/* Banner - Mobile First Base */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 1.25rem 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}

.cookie-banner-text {
    flex: 1;
}

.cookie-banner-text h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.cookie-banner-text a:hover {
    color: #1d4ed8;
}

.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: stretch;
}

.cookie-banner-actions .cookie-btn {
    flex: 1;
}

.cookie-banner-actions .cookie-btn-link {
    flex: none;
    width: 100%;
}

.cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    white-space: nowrap;
    /* Touch-friendly minimum size */
    min-height: 44px;
}

/* Touch device active states */
@media (hover: none) {
    .cookie-btn:active {
        transform: scale(0.98);
    }
}

.cookie-btn-primary {
    background: #2563eb;
    color: white;
}

.cookie-btn-primary:hover {
    background: #1d4ed8;
}

.cookie-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.cookie-btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.cookie-btn-link {
    background: transparent;
    color: #475569;
    padding: 0.7rem 0.5rem;
}

.cookie-btn-link:hover {
    color: #2563eb;
}

/* Settings Modal */
.cookie-settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-settings-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.cookie-settings-modal {
    background: #ffffff;
    border-radius: 16px;
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.cookie-settings-overlay.visible .cookie-settings-modal {
    transform: translateY(0);
}

.cookie-settings-header {
    padding: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-settings-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.cookie-settings-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s;
    /* Touch-friendly minimum size */
    min-width: 44px;
    min-height: 44px;
}

.cookie-settings-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.cookie-settings-body {
    padding: 1.25rem;
}

.cookie-settings-intro {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.cookie-category {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.85rem;
}

.cookie-category:last-child {
    margin-bottom: 0;
}

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

.cookie-category-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
}

.cookie-category-desc {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
}

/* Toggle Switch - Touch-friendly */
.cookie-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    /* Touch-friendly tap area */
    min-width: 48px;
    min-height: 26px;
}

.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: #cbd5e1;
    transition: 0.3s;
    border-radius: 26px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #2563eb;
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: #22c55e;
    cursor: not-allowed;
}

.cookie-toggle-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-left: 0.5rem;
}

.cookie-settings-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cookie-settings-footer .cookie-btn {
    width: 100%;
}

/* ============================================
   RESPONSIVE - Tablet (min-width: 480px)
   ============================================ */

@media (min-width: 480px) {
    .cookie-banner-actions .cookie-btn-link {
        flex: 1;
        width: auto;
    }

    .cookie-settings-header {
        padding: 1.5rem;
    }

    .cookie-settings-header h3 {
        font-size: 1.25rem;
    }

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

    .cookie-category {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    .cookie-settings-footer {
        flex-direction: row;
        padding: 1.25rem 1.5rem;
        justify-content: flex-end;
    }

    .cookie-settings-footer .cookie-btn {
        width: auto;
    }
}

/* ============================================
   RESPONSIVE - Tablet & Desktop (min-width: 768px)
   ============================================ */

@media (min-width: 768px) {
    .cookie-banner {
        padding: 1.5rem 2rem;
    }

    .cookie-banner-content {
        flex-direction: row;
        align-items: center;
        gap: 2rem;
        flex-wrap: wrap;
    }

    .cookie-banner-text {
        min-width: 300px;
    }

    .cookie-banner-actions {
        justify-content: flex-end;
    }

    .cookie-banner-actions .cookie-btn {
        flex: none;
    }

    .cookie-banner-actions .cookie-btn-link {
        flex: none;
        width: auto;
    }
}

/* ============================================
   Touch Device Optimizations
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    .cookie-btn-primary:active {
        background: #1d4ed8;
    }

    .cookie-btn-secondary:active {
        background: #e2e8f0;
        color: #0f172a;
    }

    .cookie-btn-link:active {
        color: #2563eb;
    }

    .cookie-settings-close:active {
        background: #e2e8f0;
        color: #0f172a;
    }
}
