/**
 * GDPR/DSGVO Cookie Consent Banner - Styles
 *
 * Responsive, accessible, and modern consent banner design
 *
 * @package DividendenKalender
 * @version 1.0
 * @created 2025-11-05
 */

/* ============================================================================
   CONSENT BANNER CONTAINER
   ============================================================================ */

.consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    animation: consentSlideUp 0.3s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

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

/* ============================================================================
   OVERLAY (Darkens background) - DEAKTIVIERT
   ============================================================================ */

/* Overlay entfernt - nur Banner ohne grauen Hintergrund
.consent-banner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: -1;
}
*/

/* ============================================================================
   BANNER CONTENT
   ============================================================================ */

.consent-banner-content {
    background: #ffffff;
    border-top: 3px solid #10b981;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Custom scrollbar for modern look */
.consent-banner-content::-webkit-scrollbar {
    width: 8px;
}

.consent-banner-content::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.consent-banner-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.consent-banner-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ============================================================================
   HEADER
   ============================================================================ */

.consent-header {
    margin-bottom: 1.5rem;
}

.consent-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    line-height: 1.2;
}

.consent-icon {
    width: 28px;
    height: 28px;
    color: #10b981;
    flex-shrink: 0;
}

/* ============================================================================
   DESCRIPTION
   ============================================================================ */

.consent-description {
    margin-bottom: 1.5rem;
    color: #4b5563;
    line-height: 1.6;
    font-size: 0.9375rem;
}

.consent-description p {
    margin: 0;
}

/* ============================================================================
   CONSENT CATEGORIES
   ============================================================================ */

.consent-categories {
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    background-color: #f9fafb;
    display: none; /* Hidden by default, shown when settings clicked */
}

.consent-category {
    padding: 1rem;
    margin-bottom: 1rem;
    background: #ffffff;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.consent-category:hover {
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

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

.consent-category-header {
    margin-bottom: 0.5rem;
}

/* ============================================================================
   CHECKBOXES & LABELS
   ============================================================================ */

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.consent-checkbox {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #10b981;
}

.consent-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.consent-checkbox:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

.consent-label-text {
    flex: 1;
    color: #1f2937;
    font-size: 0.9375rem;
}

.consent-required {
    color: #6b7280;
    font-size: 0.875rem;
    margin-left: 0.5rem;
    font-weight: 400;
}

.consent-category-desc {
    margin: 0.5rem 0 0 2.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ============================================================================
   ACTION BUTTONS
   ============================================================================ */

.consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.consent-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}

.consent-btn:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

.consent-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary button (Accept All) */
.consent-btn-primary {
    background-color: #10b981;
    color: #ffffff;
}

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

.consent-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Secondary button (Reject All) */
.consent-btn-secondary {
    background-color: #6b7280;
    color: #ffffff;
}

.consent-btn-secondary:hover:not(:disabled) {
    background-color: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.consent-btn-secondary:active:not(:disabled) {
    transform: translateY(0);
}

/* Outline button (Settings) */
.consent-btn-outline {
    background-color: transparent;
    border: 2px solid #d1d5db;
    color: #4b5563;
}

.consent-btn-outline:hover:not(:disabled) {
    border-color: #9ca3af;
    background-color: #f9fafb;
}

/* Success button (Save Selection) */
.consent-btn-success {
    background-color: #3b82f6;
    color: #ffffff;
}

.consent-btn-success:hover:not(:disabled) {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.consent-btn-success:active:not(:disabled) {
    transform: translateY(0);
}

.consent-btn-icon {
    width: 18px;
    height: 18px;
}

/* ============================================================================
   FOOTER LINKS
   ============================================================================ */

.consent-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    font-size: 0.875rem;
    color: #6b7280;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.consent-link {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.consent-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.consent-link:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 2px;
}

.consent-separator {
    color: #d1d5db;
}

/* ============================================================================
   RESPONSIVE DESIGN - TABLET
   ============================================================================ */

@media (max-width: 768px) {
    .consent-banner-content {
        padding: 1.5rem;
        max-height: 90vh;
        border-radius: 0.5rem 0.5rem 0 0;
    }

    .consent-title {
        font-size: 1.25rem;
    }

    .consent-icon {
        width: 24px;
        height: 24px;
    }

    .consent-actions {
        flex-direction: column;
    }

    .consent-btn {
        width: 100%;
        justify-content: center;
    }

    .consent-category-desc {
        margin-left: 0;
        margin-top: 0.75rem;
    }
}

/* ============================================================================
   RESPONSIVE DESIGN - MOBILE
   ============================================================================ */

@media (max-width: 480px) {
    .consent-banner-content {
        padding: 1.25rem;
        border-radius: 0;
    }

    .consent-title {
        font-size: 1.125rem;
    }

    .consent-description {
        font-size: 0.875rem;
    }

    .consent-category {
        padding: 0.75rem;
    }

    .consent-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }

    .consent-footer {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.8125rem;
    }

    .consent-separator {
        display: none;
    }
}

/* ============================================================================
   DARK MODE SUPPORT (if enabled globally)
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    .consent-banner-content {
        background: #1f2937;
        border-top-color: #10b981;
    }

    .consent-title,
    .consent-label-text {
        color: #f9fafb;
    }

    .consent-description,
    .consent-category-desc,
    .consent-required {
        color: #d1d5db;
    }

    .consent-categories {
        background-color: #111827;
        border-color: #374151;
    }

    .consent-category {
        background: #111827;
        border-color: #374151;
    }

    .consent-category:hover {
        border-color: #10b981;
    }

    .consent-btn-outline {
        border-color: #4b5563;
        color: #d1d5db;
    }

    .consent-btn-outline:hover {
        background-color: #374151;
        border-color: #6b7280;
    }

    .consent-footer {
        border-top-color: #374151;
        color: #9ca3af;
    }

    .consent-separator {
        color: #4b5563;
    }
}

/* ============================================================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================================================ */

/* Focus visible for keyboard navigation */
.consent-banner :focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .consent-banner,
    .consent-btn,
    .consent-category {
        animation: none;
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .consent-banner-content {
        border: 2px solid currentColor;
    }

    .consent-btn {
        border: 2px solid currentColor;
    }
}

/* ============================================================================
   PRINT STYLES (hide banner in print)
   ============================================================================ */

@media print {
    .consent-banner {
        display: none !important;
    }
}
