/* ============================================================
   ОРИГИНАЛЕН КОД (admin calendar, day cards, etc.)
   ============================================================ */

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.calendar-table th,
.calendar-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    width: 14.28%;
    height: 60px;
    vertical-align: middle;
}

.calendar-table th {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
}

.calendar-table td.has-data { background-color: #e8f5e9; }
.calendar-table td.has-data a {
    display: block; width: 100%; text-decoration: none;
    color: #2196F3; font-weight: bold; font-size: 10px; padding: 0;
}
.calendar-table td.has-data a:hover { background-color: #c8e6c9; color: #1976D2; }
.calendar-table td.empty { background-color: #f5f5f5; }
.calendar-table td .no-data { color: #999; }
.calendar-table td .empty-cell { color: #f5f5f5; }

.events-list {
    display: flex; flex-direction: column; gap: 4px;
    width: 100%; margin-top: 5px; flex: 1; overflow-y: initial;
}

.event-link {
    display: flex; flex-direction: column; padding: 4px 6px;
    background-color: #3498db; color: white !important;
    text-decoration: none; border-radius: 3px; font-size: 10px;
    transition: all 0.2s ease; border-left: 3px solid #2980b9;
    flex-shrink: 0; box-sizing: border-box; max-width: 100%;
}
.event-link:hover {
    background-color: #2980b9; transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); filter: brightness(0.9);
}

.event-time { font-weight: bold; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.event-person { font-size: 9px; opacity: 0.9; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }

.calendar-table td.has-data { padding: 5px; vertical-align: top; height: auto; min-height: 120px; }
.day-cell { display: flex; flex-direction: column; height: 100%; min-height: 100px; }
.day-number { font-size: 14px; font-weight: bold; color: #2c3e50; margin-bottom: 5px; flex-shrink: 0; }

.event-link.status-free    { background-color: #27ae60; border-left-color: #229954; }
.event-link.status-free:hover { background-color: #229954; }
.event-link.status-free::before { content: "✓ "; font-weight: bold; margin-right: 2px; }
.event-link.status-booked  { background-color: #f39c12; border-left-color: #e67e22; }
.event-link.status-booked:hover { background-color: #e67e22; }
.event-link.status-booked::before { content: "⏱ "; margin-right: 2px; }
.event-link.status-confirmed { background-color: #e74c3c; border-left-color: #c0392b; }
.event-link.status-confirmed:hover { background-color: #c0392b; }
.event-link.status-confirmed::before { content: "✓ "; font-weight: bold; margin-right: 2px; }

.calendar-table td { overflow: hidden; position: relative; }
.calendar-table td .day-cell { width: 100%; box-sizing: border-box; }

@-moz-document url-prefix() {
    .event-link { max-width: calc(100% - 2px); }
    .events-list { max-width: 100%; overflow: hidden; }
    .day-cell { overflow: hidden; }
}

.myday-list-wrapper { max-width: 1400px; margin: 0 auto; padding: 20px; }
.actions-bar { display: flex; justify-content: space-between; margin-bottom: 30px; padding: 15px; background-color: #ecf0f1; border-radius: 8px; }
.days-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 20px; margin-top: 20px; }

.day-card { background: white; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); overflow: hidden; transition: all 0.3s ease; }
.day-card:hover { transform: translateY(-5px); box-shadow: 0 6px 16px rgba(0,0,0,0.15); }
.day-card-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 20px; display: flex; justify-content: space-between; align-items: center; }
.day-date { margin: 0; font-size: 1.3em; font-weight: bold; }
.month-badge { background-color: rgba(255,255,255,0.3); padding: 5px 12px; border-radius: 15px; font-size: 0.9em; font-weight: bold; }
.day-card-body { padding: 20px; }
.day-info-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #ecf0f1; }
.day-info-item:last-child { border-bottom: none; }
.info-label { font-weight: bold; color: #7f8c8d; font-size: 0.9em; }
.info-value { color: #2c3e50; font-size: 1em; }
.info-value.workshift { background-color: #9b59b6; color: white; padding: 3px 10px; border-radius: 5px; font-weight: bold; }
.day-card-footer { padding: 15px 20px; background-color: #f8f9fa; display: flex; gap: 10px; justify-content: flex-end; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-warning { background-color: #f39c12; color: white; }
.btn-warning:hover { background-color: #e67e22; }
.btn-danger { background-color: #e74c3c; color: white; }
.btn-danger:hover { background-color: #c0392b; }

.public-booking .subtitle { text-align: center; color: #7f8c8d; margin-bottom: 30px; font-size: 1.1em; }
.event-link.booked { background-color: #e74c3c !important; border-left-color: #c0392b !important; cursor: not-allowed; opacity: 0.7; }
.event-link.available { background-color: #27ae60 !important; border-left-color: #229954 !important; }
.event-link.available:hover { background-color: #229954 !important; transform: scale(1.05); }
.event-status { font-size: 9px; font-weight: bold; margin-top: 2px; }
.event-link.past { background: #b0b0b0; color: #fff; cursor: default; opacity: 0.6; pointer-events: none; display: block; padding: 3px 6px; border-radius: 4px; font-size: 11px; margin-bottom: 2px; }

@media (max-width: 768px) {
    .days-grid { grid-template-columns: 1fr; }
    .actions-bar { flex-direction: column; gap: 10px; }
    .day-card-footer { flex-wrap: wrap; }
}


/* ============================================================
   HUBSPOT-STYLE PUBLIC BOOKING
   ============================================================ */

/* Wrapper — две колони */
.hs-booking-wrapper {
    display: flex;
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f7f8fc;
    max-width: 1100px;
    margin: 30px auto;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.12);
    overflow: hidden;
}

/* ── Лява колона ─────────────────────────────────────────── */
.hs-sidebar {
    width: 300px;
    min-width: 260px;
    background: #fff;
    border-right: 1px solid #e8eaf0;
    flex-shrink: 0;
}

.hs-sidebar-inner {
    padding: 40px 32px;
    position: sticky;
    top: 20px;
}

.hs-logo {
    margin-bottom: 20px;
}
.hs-logo img {
    max-width: 120px;
    height: auto;
}

.hs-org {
    font-size: 12px;
    font-weight: 600;
    color: #8b93a7;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 6px;
}

.hs-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1f36;
    margin: 0 0 24px;
    line-height: 1.3;
}

.hs-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #3d4468;
    margin-bottom: 10px;
}
.hs-meta-icon { font-size: 16px; }

.hs-divider {
    border: none;
    border-top: 1px solid #e8eaf0;
    margin: 24px 0;
}

.hs-desc {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 28px;
}

/* Legend */
.hs-legend { display: flex; flex-direction: column; gap: 8px; }
.hs-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #6b7280; }
.hs-dot {
    width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.hs-dot.available  { background: #27ae60; }
.hs-dot.booked     { background: #f39c12; }
.hs-dot.confirmed  { background: #e74c3c; }
.hs-dot.past       { background: #b0b0b0; }

/* ── Дясна колона ────────────────────────────────────────── */
.hs-main {
    flex: 1;
    padding: 40px 36px;
    overflow-y: auto;
    background: #f7f8fc;
}

/* Месец блок */
.hs-month-block {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    margin-bottom: 32px;
    overflow: hidden;
}

.hs-month-header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid #e8eaf0;
}

.hs-month-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1f36;
    margin: 0;
}

/* Календарна таблица */
.hs-cal-table {
    width: 100%;
    border-collapse: collapse;
}

.hs-cal-table thead th {
    padding: 10px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #8b93a7;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid #e8eaf0;
    background: #fafbff;
}

.hs-cal-table thead th.hs-weekend { color: #c0c4d0; }

.hs-cell {
    width: 14.28%;
    padding: 6px 4px;
    vertical-align: top;
    border: none;
    border-bottom: 1px solid #f0f1f5;
}

.hs-cell.hs-empty    { background: transparent; }
.hs-cell.hs-today    { background: #f0f4ff; }
.hs-cell.hs-past-cell { opacity: 0.6; }
.hs-cell.hs-weekend-cell { background: #fafafa; }

.hs-day-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-height: 56px;
}

.hs-day-num {
    font-size: 13px;
    font-weight: 600;
    color: #3d4468;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.hs-day-num.hs-today-num {
    background: #4f46e5;
    color: #fff;
}

/* Слотове */
.hs-slots {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}

.hs-slot {
    display: block;
    text-align: center;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Свободен — зелен */
.hs-slot-free {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.hs-slot-free:hover {
    background: #27ae60;
    color: #fff;
    transform: scale(1.04);
    box-shadow: 0 3px 10px rgba(39,174,96,0.35);
}

/* Заявен — оранжев */
.hs-slot-booked {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    cursor: not-allowed;
    pointer-events: none;
}

/* Потвърден — червен */
.hs-slot-confirmed {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border: 1px solid #fecaca !important;
    cursor: not-allowed;
    pointer-events: none;
}

/* Минал — сив */
.hs-slot-past {
    background: #f1f1f1;
    color: #a0a0a0;
    border: 1px solid #e0e0e0;
    cursor: default;
    pointer-events: none;
    font-size: 10px;
    border-radius: 6px;
    padding: 4px 6px;
    text-align: center;
    display: block;
}

/* ── Modal ───────────────────────────────────────────────── */
.hs-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.hs-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.18);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: hs-modal-in 0.2s ease;
}

@keyframes hs-modal-in {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.hs-modal-close {
    position: absolute;
    top: 16px; right: 20px;
    background: none; border: none;
    font-size: 22px; color: #8b93a7;
    cursor: pointer; line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.hs-modal-close:hover { background: #f1f3f9; color: #1a1f36; }

.hs-modal-header {
    padding: 28px 32px 0;
    border-bottom: 1px solid #e8eaf0;
    padding-bottom: 16px;
}
.hs-modal-title {
    font-size: 18px; font-weight: 700; color: #1a1f36; margin: 0;
}

.hs-modal-body { padding: 24px 32px 32px; }

/* Spinner */
.hs-spinner {
    display: flex; justify-content: center; align-items: center;
    padding: 40px 0;
}
.hs-spinner-ring {
    width: 36px; height: 36px;
    border: 3px solid #e8eaf0;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: hs-spin 0.7s linear infinite;
}
@keyframes hs-spin { to { transform: rotate(360deg); } }

/* Success / Error */
.hs-success {
    text-align: center; padding: 20px 0;
}
.hs-success-icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: #27ae60; color: #fff;
    font-size: 32px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.hs-success h3 { color: #1a1f36; margin: 0 0 8px; font-size: 20px; }
.hs-success p  { color: #6b7280; font-size: 14px; margin: 4px 0; }

.hs-error {
    background: #fee2e2; color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px; padding: 12px 16px;
    font-size: 14px; margin-bottom: 16px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .hs-booking-wrapper {
        flex-direction: column;
        margin: 0;
        border-radius: 0;
    }
    .hs-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e8eaf0;
    }
    .hs-sidebar-inner { padding: 24px 20px; position: static; }
    .hs-main { padding: 20px 16px; }
    .hs-modal { border-radius: 12px 12px 0 0; max-height: 95vh; }
    .hs-modal-body { padding: 16px 20px 24px; }
    .hs-modal-header { padding: 20px 20px 14px; }
    .days-grid { grid-template-columns: 1fr; }
    .actions-bar { flex-direction: column; gap: 10px; }
    .day-card-footer { flex-wrap: wrap; }
}


/* ============================================================
   HS DAY BUTTONS (клик на ден показва слотове в sidebar)
   ============================================================ */

.hs-cell { padding: 3px; }

.hs-day-btn {
    width: 100%;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: default;
    padding: 6px 4px;
    transition: background 0.15s, box-shadow 0.15s;
}

/* Ден СЪС слотове */
.hs-day-has-slots {
    cursor: pointer;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
}
.hs-day-has-slots:hover {
    background: #dcfce7;
    box-shadow: 0 2px 8px rgba(39,174,96,0.2);
}
.hs-day-has-slots.hs-day-active {
    background: #166534;
    border-color: #166534;
    box-shadow: 0 4px 14px rgba(22,101,52,0.35);
}
.hs-day-has-slots.hs-day-active .hs-day-num {
    color: #fff;
}

/* Минал ден */
.hs-day-past {
    opacity: 0.45;
    cursor: not-allowed;
    background: #f5f5f5;
    border: 1.5px solid #e0e0e0;
}

/* Ден БЕЗ слотове */
.hs-day-no-slots {
    opacity: 0.5;
}

/* Точките под числото */
.hs-day-dot-row {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    justify-content: center;
}

.hs-mini-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}
.hs-mini-dot.dot-free      { background: #27ae60; }
.hs-mini-dot.dot-booked    { background: #f39c12; }
.hs-mini-dot.dot-confirmed { background: #e74c3c; }
.hs-mini-dot.dot-past      { background: #b0b0b0; }

/* ── Слот бутони в sidebar ─────────────────────────────── */

.hs-slots-date-label {
    font-size: 15px;
    font-weight: 700;
    color: #1a1f36;
    margin: 0 0 14px;
}

.hs-slots-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hs-slot-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.hs-slot-time {
    font-size: 14px;
    font-weight: 700;
}

.hs-slot-status {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.85;
}

/* Свободен */
.hs-slot-btn-free {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}
.hs-slot-btn-free:hover {
    background: #27ae60;
    border-color: #27ae60;
    color: #fff;
    box-shadow: 0 4px 14px rgba(39,174,96,0.3);
    transform: translateX(3px);
}

/* Анкетиран */
.hs-slot-btn-booked {
    background: #fef9c3;
    border-color: #fde047;
    color: #713f12;
    cursor: not-allowed;
    opacity: 0.75;
}

/* Потвърден */
.hs-slot-btn-confirmed {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
    cursor: not-allowed;
    opacity: 0.75;
}

/* Минал */
.hs-slot-btn-past {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.hs-no-slots {
    color: #9ca3af;
    font-size: 13px;
    font-style: italic;
}
