/**
 * BISpicy Cookie Consent Styles
 * DSGVO/GDPR compliant design
 *
 * Design requirements (avoiding dark patterns):
 * - Accept and Reject buttons have equal visual weight
 * - Clear, readable text
 * - Easy to understand categories
 * - Accessible design (WCAG 2.1)
 */

/* Cookie Consent Banner */
.cookie-consent-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cookie-consent-banner.show {
    display: flex;
}

/* Overlay */
.cookie-consent-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

/* Container */
.cookie-consent-container {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: cookieSlideIn 0.3s ease-out;
}

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

/* Header */
.cookie-consent-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.cookie-consent-header h2 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.cookie-consent-header p {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Body */
.cookie-consent-body {
    padding: 1rem 1.5rem;
}

/* Categories */
.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cookie-category {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1rem;
    transition: background-color 0.2s;
}

.cookie-category:hover {
    background: #f3f4f6;
}

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

.cookie-category-info {
    flex: 1;
}

.cookie-category-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cookie-required {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 400;
}

.cookie-category-desc {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.4;
}

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

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

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

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: #10b981;
    cursor: not-allowed;
    opacity: 0.7;
}

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

.cookie-toggle input:focus + .cookie-toggle-slider {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

/* Footer */
.cookie-consent-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.cookie-consent-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Buttons - EQUAL VISUAL WEIGHT (GDPR requirement - no dark patterns) */
.cookie-btn {
    flex: 1;
    min-width: 150px;
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    text-align: center;
}

/* Reject button - Same visual weight as Accept */
.cookie-btn-reject {
    background: #ffffff;
    color: #374151;
    border-color: #d1d5db;
}

.cookie-btn-reject:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Save button */
.cookie-btn-save {
    background: #ffffff;
    color: #374151;
    border-color: #d1d5db;
}

.cookie-btn-save:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Accept button - Same size, slightly different style but not overpowering */
.cookie-btn-accept {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

.cookie-btn-accept:hover {
    background: #059669;
    border-color: #059669;
}

/* Links */
.cookie-consent-links {
    margin-top: 1rem;
    text-align: center;
}

.cookie-consent-links a {
    color: #6b7280;
    font-size: 0.85rem;
    text-decoration: underline;
    transition: color 0.2s;
}

.cookie-consent-links a:hover {
    color: #374151;
}

/* Settings Button (floating) */
.cookie-settings-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #374151;
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s;
    z-index: 9998;
}

.cookie-settings-button:hover {
    background: #1f2937;
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 576px) {
    .cookie-consent-container {
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
        margin-top: auto;
    }

    .cookie-consent-header {
        padding: 1.25rem 1rem 0.75rem;
    }

    .cookie-consent-header h2 {
        font-size: 1.25rem;
    }

    .cookie-consent-body {
        padding: 0.75rem 1rem;
    }

    .cookie-consent-footer {
        padding: 0.75rem 1rem 1.25rem;
    }

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

    .cookie-btn {
        min-width: 100%;
    }

    .cookie-settings-button {
        bottom: 15px;
        left: 15px;
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-container {
        animation: none;
    }

    .cookie-toggle-slider,
    .cookie-toggle-slider:before,
    .cookie-btn,
    .cookie-settings-button {
        transition: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .cookie-consent-container {
        border: 2px solid #000;
    }

    .cookie-btn {
        border-width: 3px;
    }

    .cookie-category {
        border: 1px solid #6b7280;
    }
}
