/* =========================================================
   Booking Calendar – Stylesheet
   Inspired by Beskidy365 design (teal/mint palette)
   ========================================================= */

:root {
    --bc-teal:        #3ec9a7;
    --bc-teal-dark:   #2aa68a;
    --bc-teal-light:  #d4f5ed;
    --bc-teal-xlight: #f0faf7;
    --bc-text:        #1a2e2a;
    --bc-muted:       #6b8a82;
    --bc-border:      #c8e8e0;
    --bc-white:       #ffffff;
    --bc-gray:        #f4f7f6;
    --bc-danger:      #e05252;
    --bc-radius:      14px;
    --bc-radius-sm:   8px;
    --bc-shadow:      0 4px 24px rgba(62,201,167,.15);
    --bc-shadow-md:   0 8px 40px rgba(62,201,167,.22);
    --bc-font:        'Segoe UI', 'Roboto', sans-serif;
    --bc-transition:  .22s cubic-bezier(.4,0,.2,1);
}

/* ── Root container ── */
.bc-root {
    font-family: var(--bc-font);
    color: var(--bc-text);
    max-width: 780px;
    margin: 0 auto;
    padding: 8px 0 40px;
    -webkit-font-smoothing: antialiased;
}

/* ── Steps indicator ── */
.bc-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
    flex-wrap: nowrap;
}

.bc-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.bc-step span {
    font-size: 12px;
    color: var(--bc-muted);
    font-weight: 500;
    transition: color var(--bc-transition);
    white-space: nowrap;
}

.bc-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bc-border);
    color: var(--bc-muted);
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--bc-transition), color var(--bc-transition), box-shadow var(--bc-transition);
}

.bc-step.active .bc-step-number {
    background: var(--bc-teal);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(62,201,167,.25);
}

.bc-step.active span {
    color: var(--bc-teal-dark);
    font-weight: 700;
}

.bc-step.done .bc-step-number {
    background: var(--bc-teal-dark);
    color: #fff;
}

.bc-step.done .bc-step-number::after {
    content: '✓';
}

.bc-step.done .bc-step-number {
    font-size: 0;
}

.bc-step.done .bc-step-number::after {
    font-size: 16px;
}

.bc-step-line {
    flex: 1;
    height: 3px;
    background: var(--bc-border);
    margin: 0 10px;
    margin-bottom: 22px;
    border-radius: 2px;
    min-width: 30px;
    transition: background var(--bc-transition);
}

.bc-step-line.done {
    background: var(--bc-teal);
}

/* ── Panel ── */
.bc-panel {
    display: none;
    background: var(--bc-white);
    border-radius: var(--bc-radius);
    box-shadow: var(--bc-shadow);
    padding: 28px 28px 32px;
    animation: bc-fade-in .3s ease;
}

.bc-panel-active {
    display: block;
}

@keyframes bc-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bc-panel-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--bc-text);
    margin: 0 0 6px;
}

.bc-subtitle {
    font-size: 14px;
    color: var(--bc-muted);
    margin: 0 0 22px;
}

/* ── Calendar nav ── */
.bc-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.bc-nav-btn {
    background: var(--bc-teal-light);
    border: none;
    border-radius: var(--bc-radius-sm);
    width: 38px;
    height: 38px;
    font-size: 22px;
    cursor: pointer;
    color: var(--bc-teal-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--bc-transition), transform var(--bc-transition);
    line-height: 1;
}

.bc-nav-btn:hover {
    background: var(--bc-teal);
    color: #fff;
    transform: scale(1.08);
}

.bc-month-label {
    font-size: 17px;
    font-weight: 700;
    color: var(--bc-text);
    text-transform: capitalize;
    letter-spacing: .02em;
}

/* ── Calendar header (days) ── */
.bc-calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 6px;
}

.bc-calendar-header span {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--bc-muted);
    padding: 6px 0;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ── Calendar grid ── */
.bc-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.bc-day {
    aspect-ratio: 1;
    border-radius: var(--bc-radius-sm);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--bc-transition);
    background: var(--bc-teal-xlight);
    color: var(--bc-text);
    user-select: none;
}

/* Diagonal stripe pattern (like Beskidy365) */
.bc-day::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 5px,
        rgba(62,201,167,.12) 5px,
        rgba(62,201,167,.12) 10px
    );
    opacity: 0;
    transition: opacity var(--bc-transition);
}

.bc-day.available {
    background: var(--bc-teal);
    color: #fff;
}

.bc-day.available::before {
    opacity: 0;
}

.bc-day.available:hover {
    background: var(--bc-teal-dark);
    transform: scale(1.06);
    box-shadow: 0 4px 12px rgba(62,201,167,.4);
}

.bc-day.partial {
    background: var(--bc-teal-light);
    color: var(--bc-teal-dark);
}

.bc-day.partial::before {
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 5px,
        rgba(62,201,167,.35) 5px,
        rgba(62,201,167,.35) 10px
    );
    opacity: 1;
}

.bc-day.partial:hover {
    background: var(--bc-teal);
    color: #fff;
    transform: scale(1.06);
}

.bc-day.today {
    border-color: var(--bc-teal-dark);
    font-weight: 800;
}

.bc-day.selected {
    background: var(--bc-teal-dark) !important;
    color: #fff !important;
    border-color: var(--bc-teal-dark);
    box-shadow: 0 0 0 3px rgba(62,201,167,.35);
    transform: scale(1.1);
}

.bc-day.blocked,
.bc-day.past,
.bc-day.empty {
    background: transparent;
    color: #c4cdc9;
    cursor: default;
    pointer-events: none;
}

.bc-day.blocked::after {
    content: '×';
    font-size: 18px;
    color: #c4cdc9;
}

.bc-day.blocked span {
    display: none;
}

/* ── Legend ── */
.bc-legend {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.bc-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--bc-muted);
}

.bc-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    flex-shrink: 0;
}

.bc-dot-avail   { background: var(--bc-teal); }
.bc-dot-today   { background: var(--bc-teal-light); border: 2px solid var(--bc-teal-dark); }
.bc-dot-blocked { background: #e8eceb; }

/* ── Time grid ── */
.bc-time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}

.bc-time-slot {
    padding: 12px 8px;
    border-radius: var(--bc-radius-sm);
    border: 2px solid var(--bc-border);
    background: var(--bc-teal-xlight);
    color: var(--bc-teal-dark);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all var(--bc-transition);
    user-select: none;
}

.bc-time-slot:hover {
    background: var(--bc-teal);
    color: #fff;
    border-color: var(--bc-teal);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(62,201,167,.3);
}

.bc-time-slot.selected {
    background: var(--bc-teal-dark);
    color: #fff;
    border-color: var(--bc-teal-dark);
    box-shadow: 0 0 0 3px rgba(62,201,167,.3);
}

.bc-time-slot.booked {
    background: #f4f4f4;
    color: #bbb;
    cursor: not-allowed;
    border-color: #e5e5e5;
    text-decoration: line-through;
    pointer-events: none;
}

/* ── Form ── */
.bc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.bc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.bc-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--bc-text);
}

.bc-field input {
    padding: 12px 14px;
    border: 2px solid var(--bc-border);
    border-radius: var(--bc-radius-sm);
    font-size: 15px;
    font-family: var(--bc-font);
    color: var(--bc-text);
    background: var(--bc-gray);
    transition: border-color var(--bc-transition), box-shadow var(--bc-transition);
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.bc-field input:focus {
    border-color: var(--bc-teal);
    background: var(--bc-white);
    box-shadow: 0 0 0 3px rgba(62,201,167,.18);
}

.bc-field input.bc-invalid {
    border-color: var(--bc-danger);
    box-shadow: 0 0 0 3px rgba(224,82,82,.15);
}

/* ── Buttons ── */
.bc-nav-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

.bc-btn {
    padding: 13px 28px;
    border-radius: var(--bc-radius-sm);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--bc-font);
    cursor: pointer;
    border: none;
    transition: all var(--bc-transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: .02em;
}

.bc-btn-primary {
    background: var(--bc-teal);
    color: #fff;
    box-shadow: 0 4px 16px rgba(62,201,167,.3);
}

.bc-btn-primary:hover {
    background: var(--bc-teal-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(62,201,167,.4);
}

.bc-btn-secondary {
    background: var(--bc-gray);
    color: var(--bc-muted);
    border: 2px solid var(--bc-border);
}

.bc-btn-secondary:hover {
    background: var(--bc-border);
    color: var(--bc-text);
}

/* ── Error message ── */
.bc-error-msg {
    color: var(--bc-danger);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: var(--bc-radius-sm);
    background: rgba(224,82,82,.08);
    margin-bottom: 12px;
    display: none;
    border-left: 3px solid var(--bc-danger);
}

.bc-error-msg.visible {
    display: block;
}

/* ── Spinner ── */
.bc-spinner {
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bc-spin .7s linear infinite;
    display: inline-block;
}

@keyframes bc-spin {
    to { transform: rotate(360deg); }
}

/* ── Success panel ── */
.bc-success-panel {
    text-align: center;
    padding: 48px 28px;
}

.bc-success-icon {
    width: 72px;
    height: 72px;
    background: var(--bc-teal);
    border-radius: 50%;
    color: #fff;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(62,201,167,.4);
    animation: bc-pop .45s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes bc-pop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.bc-success-panel h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--bc-text);
    margin: 0 0 8px;
}

.bc-success-note {
    font-size: 13px;
    color: var(--bc-muted);
    margin: 4px 0 28px;
}

/* ── Loading skeleton ── */
.bc-loading {
    text-align: center;
    padding: 20px;
    color: var(--bc-muted);
    font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .bc-panel {
        padding: 18px 14px 22px;
    }

    .bc-steps {
        gap: 0;
    }

    .bc-step span {
        font-size: 10px;
    }

    .bc-step-number {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }

    .bc-step-line {
        min-width: 16px;
    }

    .bc-day {
        font-size: 12px;
        border-radius: 6px;
    }

    .bc-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .bc-time-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    .bc-nav-buttons {
        flex-direction: column-reverse;
    }

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

    .bc-month-label {
        font-size: 15px;
    }

    .bc-panel-title {
        font-size: 17px;
    }
}

@media (max-width: 380px) {
    .bc-day {
        font-size: 11px;
    }

    .bc-calendar-grid {
        gap: 2px;
    }
}
