/* ═══════════════════════════════════════════════════════════════════
   SVC Badbelegung — Frontend Widget
   Designed to sit inside the SV Cannstatt theme (Rot/Weiß)
   ═══════════════════════════════════════════════════════════════════ */

.svc-bb-widget {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.025);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1F2937;
    max-width: 100%;
}

/* ── Header ───────────────────────────────────────────────────────── */
.svc-bb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}

.svc-bb-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.svc-bb-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.svc-bb-status-dot.is-open {
    background: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    animation: svc-bb-pulse 2s ease-in-out infinite;
}

.svc-bb-status-dot.is-closed {
    background: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

@keyframes svc-bb-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.svc-bb-status-text {
    font-weight: 700;
    font-size: 0.92rem;
}

.svc-bb-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.svc-bb-time {
    font-size: 0.82rem;
    color: #6B7280;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.svc-bb-special-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
    background: #FEF3C7;
    color: #92400E;
    white-space: nowrap;
}

.svc-bb-special-badge::before {
    content: '⚠';
    margin-right: 4px;
}

/* ── Section label ────────────────────────────────────────────────── */
.svc-bb-section {
    margin-bottom: 18px;
}

.svc-bb-section-soon {
    opacity: 0.85;
}

.svc-bb-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6B7280;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.svc-bb-free-count {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    background: #F0FDF4;
    color: #166534;
}

/* ── Lane tiles grid ──────────────────────────────────────────────── */
.svc-bb-lanes {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.svc-bb-lanes-muted .svc-bb-lane {
    opacity: 0.75;
}

.svc-bb-lane {
    border: 2px solid;
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 62px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.svc-bb-lane:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.svc-bb-lane-num {
    font-size: 0.62rem;
    font-weight: 700;
    opacity: 0.65;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.svc-bb-lane-act {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.25;
    word-break: break-word;
    hyphens: auto;
}

.svc-bb-lane-free {
    background: #F0FDF4 !important;
    border-color: #BBF7D0 !important;
    color: #166534 !important;
}

.svc-bb-lane-closed {
    background: #F3F4F6 !important;
    border-color: #D1D5DB !important;
    color: #9CA3AF !important;
    border-style: dashed !important;
}

.svc-bb-lane-closed .svc-bb-lane-act {
    font-style: italic;
}

/* ── Footer / Legend ──────────────────────────────────────────────── */
.svc-bb-footer {
    border-top: 1px solid #F3F4F6;
    padding-top: 14px;
    margin-top: 4px;
}

.svc-bb-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.svc-bb-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    color: #6B7280;
    font-weight: 500;
}

.svc-bb-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    border: 1px solid;
    flex-shrink: 0;
}

.svc-bb-meta {
    font-size: 0.7rem;
    color: #9CA3AF;
    line-height: 1.6;
}

.svc-bb-link {
    display: inline-block;
    margin-left: 6px;
    color: #B91C1C;
    text-decoration: none;
    font-weight: 600;
}

.svc-bb-link:hover {
    text-decoration: underline;
}

/* ── Loading state ────────────────────────────────────────────────── */
.svc-bb-widget.is-loading .svc-bb-lane {
    animation: svc-bb-shimmer 1.5s ease-in-out infinite;
}

@keyframes svc-bb-shimmer {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .svc-bb-widget {
        padding: 18px 16px;
        border-radius: 14px;
    }

    .svc-bb-lanes {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .svc-bb-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .svc-bb-lane {
        min-height: 56px;
        padding: 8px 4px;
    }

    .svc-bb-lane-act {
        font-size: 0.66rem;
    }
}

@media (max-width: 380px) {
    .svc-bb-lanes {
        grid-template-columns: repeat(2, 1fr);
    }
}
