/* ================================================================
   APPOINTMENTS CALENDAR - Indigo Theme
   ================================================================ */

.appt-calendar-wrap {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(99,102,241,0.08);
    overflow: hidden;
    border: 1px solid #F1F5F9;
}

/* Toolbar */
.appt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #E2E8F0;
    background: #fff;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.appt-toolbar-left,
.appt-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.appt-toolbar h3 {
    font-size: 14px;
    font-weight: 600;
    color: #0F172A;
    margin: 0;
    white-space: nowrap;
}

.appt-toolbar .form-control {
    padding: 0.3rem 0.5rem;
    font-size: 14px;
    border-radius: 8px;
    border: 1.5px solid #E2E8F0;
    min-width: 120px;
    color: #0F172A;
}

.appt-toolbar .form-control:focus {
    border-color: #818CF8;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.15);
}

.appt-toolbar .btn {
    padding: 0.35rem 0.6rem;
    font-size: 13px;
    border-radius: 8px;
}

/* Search & Filter bar */
.appt-filterbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-bottom: 1px solid #E2E8F0;
    background: #F8FAFC;
}

.appt-filterbar input {
    flex: 1;
    max-width: 240px;
    padding: 0.3rem 0.6rem;
    font-size: 13px;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    color: #0F172A;
}

.appt-filterbar .form-control {
    padding: 0.3rem 0.5rem;
    font-size: 13px;
    border-radius: 8px;
    border: 1.5px solid #E2E8F0;
    color: #0F172A;
}

/* Calendar Grid */
.appt-grid {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.appt-time-col {
    width: 50px;
    flex-shrink: 0;
    border-right: 1px solid #E2E8F0;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.appt-time-header {
    height: 44px;
    border-bottom: 1px solid #E2E8F0;
    flex-shrink: 0;
}

.appt-time-slot-label {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
    font-size: 10px;
    color: #94A3B8;
    border-bottom: 1px solid #F1F5F9;
    font-weight: 500;
}

.appt-days-scroll {
    flex: 1;
    overflow: auto;
    display: flex;
}

.appt-day-col {
    flex: 1;
    min-width: 130px;
    border-right: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
}

.appt-day-col:last-child {
    border-right: none;
}

.appt-day-col.weekend {
    background: var(--surface);
}

.appt-day-col.today {
    background: #F8FAFC;
}

.appt-day-col.full-booking {
    background: #FEF2F2;
}

.appt-day-header {
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #E2E8F0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 5;
}

.appt-day-header .day-name {
    font-size: 10px;
    color: #64748B;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.appt-day-header .day-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-heading);
}

.appt-day-header .day-num.today-badge {
    background: #6366F1;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.appt-day-header .booking-count {
    font-size: 9px;
    color: #EF4444;
    font-weight: 700;
    margin-top: 1px;
}

/* Time slots */
.appt-slots {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.appt-slot {
    height: 40px;
    border-bottom: 1px solid #F1F5F9;
    position: relative;
    transition: background 0.1s;
}

.appt-slot:hover {
    background: #F8FAFC;
}

.appt-slot.drag-over {
    background: #ECFDF5;
    border: 2px dashed #10B981;
}

/* Appointment card */
.appt-card {
    position: absolute;
    left: 2px;
    right: 2px;
    top: 1px;
    bottom: 1px;
    height: 38px;
    border-radius: 6px;
    padding: 0 6px 0 2px;
    font-size: 14px;
    font-weight: 700;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    z-index: 2;
    user-select: none;
}

.appt-card:active {
    cursor: grabbing;
}

.appt-card.dragging {
    opacity: 0.35;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.appt-card.highlight {
    box-shadow: 0 0 0 2px #F59E0B;
}

.appt-card.klinik {
    background: #DBEAFE;
    color: #1E3A8A;
    border-left: 3px solid #3B82F6;
}

.appt-card.grooming {
    background: #D1FAE5;
    color: #064E3B;
    border-left: 3px solid #10B981;
}

.appt-card.petcare {
    background: #FEF9C3;
    color: #713F12;
    border-left: 3px solid #F59E0B;
}

.appt-card.petshop {
    background: #D1FAE5;
    color: #064E3B;
    border-left: 3px solid #10B981;
}

.appt-card .pet-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appt-card .grip-icon {
    font-size: 10px;
    color: inherit;
    opacity: 0.5;
    cursor: grab;
    flex-shrink: 0;
}

/* Tooltip */
.appt-tooltip {
    position: fixed;
    background: #0F172A;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.15s;
}

.appt-tooltip.show {
    opacity: 1;
}

.appt-tooltip .tt-row {
    display: flex;
    gap: 6px;
}

.appt-tooltip .tt-label {
    color: #94A3B8;
    min-width: 50px;
}

.appt-tooltip .tt-value {
    font-weight: 500;
}

/* Modal overrides for appointment form */
#appointment-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .appt-day-col {
        min-width: 100px;
    }
    .appt-toolbar {
        padding: 0.4rem;
    }
    .appt-toolbar h3 {
        font-size: 12px;
    }
}

/* ================================================================
   APPOINTMENTS CALENDAR - Dark Mode Overrides
   ================================================================ */

html[data-theme="dark"] .appt-calendar-wrap {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.4);
}

html[data-theme="dark"] .appt-toolbar {
    background: var(--surface);
    border-bottom-color: var(--border-color);
}

html[data-theme="dark"] .appt-toolbar h3 {
    color: var(--text-heading);
    font-weight: 600;
}

html[data-theme="dark"] .appt-toolbar .form-control {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

html[data-theme="dark"] .appt-toolbar .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

html[data-theme="dark"] .appt-filterbar {
    background: var(--surface);
    border-bottom-color: var(--border-color);
}

html[data-theme="dark"] .appt-filterbar input,
html[data-theme="dark"] .appt-filterbar .form-control {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

html[data-theme="dark"] .appt-filterbar input::placeholder {
    color: var(--text-muted);
}

html[data-theme="dark"] .appt-filterbar input:focus,
html[data-theme="dark"] .appt-filterbar .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

html[data-theme="dark"] .appt-time-col {
    background: var(--surface);
    border-right-color: var(--border-color);
}

html[data-theme="dark"] .appt-time-header {
    border-bottom-color: var(--border-color);
}

html[data-theme="dark"] .appt-time-slot-label {
    color: var(--text-muted);
    border-bottom-color: var(--border-color);
    font-weight: 500;
}

html[data-theme="dark"] .appt-days-scroll {
    background: var(--background);
}

html[data-theme="dark"] .appt-day-col {
    border-right-color: var(--border-color);
}

html[data-theme="dark"] .appt-day-col.weekend {
    background: rgba(99, 102, 241, 0.03);
}

html[data-theme="dark"] .appt-day-col.today {
    background: rgba(99, 102, 241, 0.08);
}

html[data-theme="dark"] .appt-day-col.full-booking {
    background: rgba(239, 68, 68, 0.06);
}

html[data-theme="dark"] .appt-day-header {
    background: var(--card-bg);
    border-bottom-color: var(--border-color);
}

html[data-theme="dark"] .appt-day-header .day-name {
    color: var(--text-muted);
    font-weight: 500;
}

html[data-theme="dark"] .appt-day-header .day-num {
    color: var(--text-heading);
    font-weight: 600;
}

html[data-theme="dark"] .appt-day-header .day-num.today-badge {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

html[data-theme="dark"] .appt-day-header .booking-count {
    color: var(--danger);
    font-weight: 600;
}

html[data-theme="dark"] .appt-slot {
    border-bottom-color: var(--border-color);
}

html[data-theme="dark"] .appt-slot:hover {
    background: rgba(99, 102, 241, 0.06);
}

html[data-theme="dark"] .appt-slot.drag-over {
    background: rgba(16, 185, 129, 0.12);
    border: 2px dashed var(--success);
}

/* Appointment cards - dark mode softer colors */
html[data-theme="dark"] .appt-card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    font-weight: 600;
}

html[data-theme="dark"] .appt-card.klinik {
    background: rgba(59, 130, 246, 0.18);
    color: #93C5FD;
    border-left-color: #3B82F6;
}

html[data-theme="dark"] .appt-card.grooming {
    background: rgba(16, 185, 129, 0.18);
    color: #6EE7B7;
    border-left-color: #10B981;
}

html[data-theme="dark"] .appt-card.petcare {
    background: rgba(245, 158, 11, 0.18);
    color: #FCD34D;
    border-left-color: #F59E0B;
}

html[data-theme="dark"] .appt-card.petshop {
    background: rgba(16, 185, 129, 0.18);
    color: #6EE7B7;
    border-left-color: #10B981;
}

html[data-theme="dark"] .appt-card.highlight {
    box-shadow: 0 0 0 2px #F59E0B;
}

html[data-theme="dark"] .appt-card .grip-icon {
    opacity: 0.6;
}

/* Tooltip */
html[data-theme="dark"] .appt-tooltip {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.5);
}

html[data-theme="dark"] .appt-tooltip .tt-label {
    color: var(--text-muted);
}

html[data-theme="dark"] .appt-tooltip .tt-value {
    color: var(--text-heading);
    font-weight: 500;
}
