/**
 * Bee1 Cookie Consent - Banner Styles
 * NASA/Xiaomi level design - Lightweight, accessible, responsive
 */

:root {
    --bee1-primary: #1e3a5f;
    --bee1-accent: #3182ce;
    --bee1-success: #38a169;
    --bee1-muted: #718096;
    --bee1-border: #e2e8f0;
    --bee1-surface: #ffffff;
}

/* Base Banner - Only shared styles, NO layout properties */
.bee1-banner {
    position: fixed;
    background: var(--bee1-surface);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    -webkit-box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 999999;
    transition: opacity 0.3s ease, transform 0.3s ease;
    -webkit-transition: opacity 0.3s ease, -webkit-transform 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    /* Safari Fixes */
    -webkit-transform: translateZ(0);
    /* Hardware acceleration */
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* Positioning - Base only, layouts override as needed */
.bee1-position-bottom {
    bottom: 20px;
    left: 20px;
    right: 20px;
    margin-bottom: env(safe-area-inset-bottom, 0);
}

.bee1-position-top {
    top: 20px;
    left: 20px;
    right: 20px;
}

.bee1-position-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Themes */
.bee1-theme-light {
    background: #ffffff;
    color: #333;
    border-color: #e0e0e0;
}

.bee1-theme-dark {
    background: #2d3748;
    color: #ffffff;
    border-color: #4a5568;
}

.bee1-theme-dark .bee1-banner-text strong {
    color: #ffffff;
}

.bee1-theme-dark .bee1-btn {
    background: #4a5568;
    color: #ffffff;
}

.bee1-theme-dark .bee1-btn-accept {
    background: #48bb78;
}

.bee1-theme-dark .bee1-btn-reject {
    background: #f56565;
}

.bee1-theme-dark .bee1-banner-text p {
    color: #cbd5e0;
}

/* Content - Only typography and colors, NO layout */
.bee1-banner-content {
    padding: 20px;
}

.bee1-banner-text strong {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a202c;
}

.bee1-banner-text p {
    margin: 0;
    color: #4a5568;
    font-size: 13px;
}

.bee1-policy-link {
    color: #3182ce;
    text-decoration: underline;
    margin-left: 5px;
}

/* Buttons - Only appearance, NO layout */
.bee1-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bee1-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.bee1-btn:active {
    transform: translateY(0);
}

.bee1-btn-accept {
    background: #48bb78;
    color: #ffffff;
}

.bee1-btn-accept:hover {
    background: #38a169;
}

.bee1-btn-reject {
    background: #f56565;
    color: #ffffff;
}

.bee1-btn-reject:hover {
    background: #e53e3e;
}

.bee1-btn-preferences {
    background: #4299e1;
    color: #ffffff;
}

.bee1-btn-preferences:hover {
    background: #3182ce;
}

.bee1-btn-cancel {
    background: #cbd5e0;
    color: #2d3748;
}

.bee1-btn-ghost {
    background: #edf2f7;
    color: #1a202c;
    border: 1px solid var(--bee1-border);
}

.bee1-btn-ghost:hover {
    background: #e2e8f0;
}

.bee1-btn-save {
    background: #48bb78;
    color: #ffffff;
}

/* Focus visible for keyboard navigation */
.bee1-btn:focus-visible {
    outline: 2px solid #4299e1;
    outline-offset: 2px;
}

/* =====================================================
   BANNER LAYOUTS - All layout-specific styles here
   ===================================================== */

/* Layout 1: Classic (Default) - Horizontal bar */
.bee1-layout-classic {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.bee1-layout-classic .bee1-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.bee1-layout-classic .bee1-banner-text {
    flex: 1;
    min-width: 300px;
}

.bee1-layout-classic .bee1-banner-text strong {
    display: block;
}

.bee1-layout-classic .bee1-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Layout 2: Box - Compact centered box */
.bee1-layout-box {
    max-width: 450px;
    width: 90%;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    border-radius: 16px;
}

.bee1-layout-box.bee1-position-bottom {
    bottom: 20px;
}

.bee1-layout-box.bee1-position-top {
    top: 20px;
}

.bee1-layout-box .bee1-banner-content {
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 25px;
    gap: 20px;
}

.bee1-layout-box .bee1-banner-text {
    width: 100%;
}

.bee1-layout-box .bee1-banner-text strong {
    display: block;
    font-size: 18px;
    margin-bottom: 12px;
}

.bee1-layout-box .bee1-banner-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
}

.bee1-layout-box .bee1-btn {
    width: 100%;
    padding: 14px 20px;
}

/* Layout 3: Minimal - Slim full-width bar */
.bee1-layout-minimal {
    border-radius: 0;
    border-left: none;
    border-right: none;
    width: 100%;
    max-width: 100%;
}

.bee1-layout-minimal.bee1-position-bottom {
    bottom: 0;
    left: 0;
    right: 0;
}

.bee1-layout-minimal.bee1-position-top {
    top: 0;
    left: 0;
    right: 0;
}

.bee1-layout-minimal .bee1-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    gap: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

.bee1-layout-minimal .bee1-banner-text {
    flex: 1;
}

.bee1-layout-minimal .bee1-banner-text strong {
    display: inline;
    font-size: 14px;
    margin-bottom: 0;
    margin-right: 8px;
}

.bee1-layout-minimal .bee1-banner-text p {
    display: inline;
    font-size: 13px;
}

.bee1-layout-minimal .bee1-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.bee1-layout-minimal .bee1-btn {
    padding: 8px 16px;
    font-size: 12px;
}

/* Layout 4: Card - Floating corner card */
.bee1-layout-card {
    max-width: 380px;
    width: 90%;
    right: 20px !important;
    left: auto !important;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.bee1-layout-card.bee1-position-bottom {
    bottom: 20px;
}

.bee1-layout-card.bee1-position-top {
    top: 20px;
}

.bee1-layout-card .bee1-banner-content {
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 16px;
}

.bee1-layout-card .bee1-banner-text {
    width: 100%;
}

.bee1-layout-card .bee1-banner-text strong {
    font-size: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bee1-layout-card .bee1-banner-text strong::before {
    content: '🍪';
    font-size: 20px;
}

.bee1-layout-card .bee1-banner-text p {
    font-size: 13px;
    line-height: 1.6;
}

.bee1-layout-card .bee1-banner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.bee1-layout-card .bee1-btn-preferences {
    grid-column: 1 / -1;
    background: transparent;
    color: #4299e1;
    border: 1px solid #4299e1;
}

.bee1-layout-card .bee1-btn-preferences:hover {
    background: #ebf8ff;
}

.bee1-layout-card .bee1-btn {
    padding: 12px 16px;
    border-radius: 8px;
}

/* =====================================================
   RTL SUPPORT
   ===================================================== */
.bee1-rtl {
    direction: rtl;
    text-align: right;
}

.bee1-rtl .bee1-policy-link {
    margin-left: 0;
    margin-right: 5px;
}

/* RTL for Classic layout */
.bee1-rtl.bee1-layout-classic .bee1-banner-content {
    flex-direction: row-reverse;
}

/* RTL for Box layout - no changes needed, centered */

/* RTL for Minimal layout */
.bee1-rtl.bee1-layout-minimal .bee1-banner-content {
    flex-direction: row-reverse;
}

.bee1-rtl.bee1-layout-minimal .bee1-banner-text strong {
    margin-right: 0;
    margin-left: 8px;
}

/* RTL for Card layout */
.bee1-rtl.bee1-layout-card {
    right: auto !important;
    left: 20px !important;
}

.bee1-rtl.bee1-layout-card .bee1-banner-text strong {
    flex-direction: row-reverse;
}

/* =====================================================
   MOBILE RESPONSIVE - Layout specific
   ===================================================== */
@media (max-width: 768px) {

    /* Classic layout mobile */
    .bee1-layout-classic {
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .bee1-layout-classic .bee1-banner-content {
        flex-direction: column;
        text-align: center;
        padding: 15px;
        gap: 15px;
    }

    .bee1-layout-classic .bee1-banner-text {
        min-width: auto;
    }

    .bee1-layout-classic .bee1-banner-actions {
        width: 100%;
        justify-content: center;
    }

    .bee1-layout-classic .bee1-btn {
        flex: 1;
        padding: 12px 8px;
        font-size: 12px;
    }

    /* Box layout mobile */
    .bee1-layout-box {
        max-width: calc(100% - 20px);
        left: 10px !important;
        right: 10px !important;
        transform: none;
    }

    /* Minimal layout mobile */
    .bee1-layout-minimal .bee1-banner-content {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .bee1-layout-minimal .bee1-banner-text strong,
    .bee1-layout-minimal .bee1-banner-text p {
        display: block;
    }

    .bee1-layout-minimal .bee1-banner-text strong {
        margin-bottom: 5px;
        margin-right: 0;
    }

    .bee1-layout-minimal .bee1-banner-actions {
        width: 100%;
        justify-content: center;
    }

    /* Card layout mobile */
    .bee1-layout-card {
        max-width: calc(100% - 20px);
        left: 10px !important;
        right: 10px !important;
    }

    .bee1-layout-card .bee1-banner-actions {
        grid-template-columns: 1fr;
    }

    .bee1-layout-card .bee1-btn-preferences {
        grid-column: 1;
    }

    /* RTL mobile adjustments */
    .bee1-rtl.bee1-layout-classic .bee1-banner-content,
    .bee1-rtl.bee1-layout-minimal .bee1-banner-content {
        flex-direction: column;
    }

    .bee1-rtl.bee1-layout-card {
        left: 10px !important;
        right: 10px !important;
    }
}

/* =====================================================
   MODAL STYLES
   ===================================================== */
.bee1-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.bee1-modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px;
    max-width: 640px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--bee1-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease;
}

.bee1-modal-content h3 {
    margin: 0 0 8px 0;
    font-size: 22px;
    color: var(--bee1-primary);
    letter-spacing: -0.2px;
}

.bee1-consent-lead {
    margin: 0 0 16px 0;
    color: var(--bee1-muted);
    line-height: 1.6;
}

.bee1-consent-header {
    margin-bottom: 12px;
}

.bee1-accordion {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 12px 0 22px 0;
}

.bee1-accordion-row {
    background: #fff;
    border: 1px solid var(--bee1-border);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.bee1-accordion-row.is-locked {
    border-style: dashed;
}

.bee1-accordion-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.bee1-accord-copy {
    flex: 1;
    min-width: 0;
}

.bee1-accord-label {
    display: block;
    font-weight: 700;
    color: var(--bee1-primary);
    margin-bottom: 4px;
    letter-spacing: -0.1px;
}

.bee1-accord-sub {
    display: block;
    color: var(--bee1-muted);
    font-size: 13px;
    line-height: 1.5;
}

.bee1-pill {
    background: rgba(49, 130, 206, 0.12);
    color: var(--bee1-accent);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bee1-switch {
    position: relative;
    display: inline-flex;
    width: 46px;
    height: 26px;
    align-items: center;
}

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

.bee1-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e0;
    transition: all 0.2s ease;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}

.bee1-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.bee1-switch input:checked + .bee1-slider {
    background: var(--bee1-primary);
    box-shadow: inset 0 0 0 1px var(--bee1-primary);
}

.bee1-switch input:checked + .bee1-slider:before {
    transform: translateX(18px);
}

.bee1-switch input:focus-visible + .bee1-slider {
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.35);
}

.bee1-switch input:disabled + .bee1-slider {
    background: #e2e8f0;
    cursor: not-allowed;
}

.bee1-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* RTL Modal */
.bee1-rtl .bee1-modal-content {
    direction: rtl;
    text-align: right;
}

.bee1-rtl .bee1-accordion-head {
    flex-direction: row-reverse;
}

.bee1-rtl .bee1-accord-copy {
    text-align: right;
}

.bee1-rtl .bee1-modal-actions {
    justify-content: flex-start;
}

@media (max-width: 768px) {
    .bee1-modal-content {
        width: 95%;
        padding: 20px;
    }
}

/* =====================================================
   ACCESSIBILITY & ANIMATIONS
   ===================================================== */

/* Accessibility */
.bee1-banner:focus-within,
.bee1-modal:focus-within {
    outline: 2px solid #4299e1;
    outline-offset: 2px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    .bee1-banner,
    .bee1-modal,
    .bee1-btn {
        transition: none;
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bee1-banner {
        border-width: 2px;
        border-color: #000;
    }

    .bee1-btn {
        border: 2px solid #000;
    }
}

/* Print styles */
@media print {

    .bee1-banner,
    .bee1-modal {
        display: none !important;
    }
}

/* =====================================================
   PRIVACY OVERVIEW
   ===================================================== */
.bee1-privacy-overview {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.bee1-privacy-text {
    font-size: 13px;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 10px;
}

.bee1-privacy-text.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bee1-toggle-privacy {
    background: none;
    border: none;
    color: #2271b1;
    cursor: pointer;
    padding: 0;
    font-size: 13px;
    text-decoration: underline;
}

.bee1-toggle-privacy:hover {
    color: #135e96;
}
