/* ==========================================================================
   RANDEVU SAAS - WORLD-CLASS APPOINTMENT CALENDAR SYSTEM
   ========================================================================== */

/* Modern Scrollbar */
#schedulerContainer::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
#schedulerContainer::-webkit-scrollbar-track {
    background: transparent;
}
#schedulerContainer::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
    transition: background 0.25s;
}
#schedulerContainer:hover::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}
#schedulerContainer::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Scheduler Table Layout */
.scheduler-table {
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin-bottom: 0;
}
.scheduler-table th, .scheduler-table td {
    border-color: #f1f5f9 !important;
}

/* Header Columns */
.scheduler-table th {
    background: #ffffff;
    border-bottom: 2px solid #e2e8f0 !important;
    padding: 12px 10px;
    user-select: none;
}
.staff-col-header {
    min-width: 260px;
    max-width: 360px;
}

/* Time Column Header & Cell */
.time-col-header {
    width: 75px;
    min-width: 75px;
    max-width: 75px;
    background: #f8fafc !important;
    color: #475569;
    font-weight: 700;
    font-size: 11.5px;
    border-right: 2px solid #e2e8f0 !important;
}
.time-col-cell {
    width: 75px;
    min-width: 75px;
    max-width: 75px;
    background: #f8fafc !important;
    font-weight: 800;
    font-size: 11.5px;
    color: #64748b;
    letter-spacing: 0.3px;
    vertical-align: top;
    padding-top: 8px !important;
    padding-left: 8px !important;
    border-right: 2px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    user-select: none;
    position: relative;
}
.time-col-cell.active-hour {
    background: #eff6ff !important;
    color: #0d6efd !important;
}

/* Scheduler Body Grid Cells */
.scheduler-table td.cell-slot {
    position: relative;
    min-width: 260px;
    max-width: 360px;
    background: #ffffff;
    border-right: 1px solid #f1f5f9 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 2px !important;
    transition: background 0.12s ease;
    /* 30-Dakika Ara Çizgisi (Half-Hour Guideline) */
    background-image: linear-gradient(to bottom, transparent 49px, #f8fafc 49px, #f8fafc 50px, transparent 50px);
}
.scheduler-table td.cell-slot:hover {
    background-color: #f8fafc !important;
}
.scheduler-table td.cell-slot:hover::after {
    content: '+ Randevu';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 700;
    color: #0d6efd;
    background: #ffffff;
    border: 1.5px dashed #93c5fd;
    padding: 4px 12px;
    border-radius: 6px;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.1);
    z-index: 2;
}

/* Aktif Saat Lazer Çizgisi (Realtime Now Line) */
.current-time-indicator {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #ef4444;
    z-index: 30;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}
.current-time-badge {
    position: absolute;
    left: 4px;
    top: -9px;
    background: #ef4444;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    z-index: 35;
    letter-spacing: 0.2px;
}
.current-time-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ffffff;
    animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot {
    0% { transform: scale(0.85); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.85); opacity: 0.8; }
}

/* Appointment Card (World-Class SaaS Card) */
.appointment-card {
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.16s ease;
    font-size: 11.5px;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border: 1px solid rgba(0,0,0,0.08);
}
.appointment-card:hover {
    z-index: 100 !important;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 12px 28px rgba(0,0,0,0.18) !important;
    height: auto !important;
    min-height: 84px !important;
}

/* Status Palettes */
.app-card-approved {
    background: #eff6ff !important;
    color: #1e3a8a !important;
    border-color: #bfdbfe !important;
    border-left: 4.5px solid #2563eb !important;
}
.app-card-approved .app-time-chip {
    background: #dbeafe;
    color: #1d4ed8;
}
.app-card-approved .app-price-chip {
    background: #ffffff;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
}
.app-card-approved .app-service-tag {
    color: #3b82f6;
}

.app-card-pending {
    background: #fffbeb !important;
    color: #78350f !important;
    border-color: #fde68a !important;
    border-left: 4.5px solid #f59e0b !important;
}
.app-card-pending .app-time-chip {
    background: #fef3c7;
    color: #b45309;
}
.app-card-pending .app-price-chip {
    background: #ffffff;
    color: #78350f;
    border: 1px solid #fde68a;
}
.app-card-pending .app-service-tag {
    color: #d97706;
}

.app-card-completed {
    background: #f0fdf4 !important;
    color: #064e3b !important;
    border-color: #bbf7d0 !important;
    border-left: 4.5px solid #16a34a !important;
}
.app-card-completed .app-time-chip {
    background: #dcfce7;
    color: #15803d;
}
.app-card-completed .app-price-chip {
    background: #ffffff;
    color: #064e3b;
    border: 1px solid #bbf7d0;
}
.app-card-completed .app-service-tag {
    color: #16a34a;
}

.app-card-canceled {
    background: #f8fafc !important;
    color: #64748b !important;
    border-color: #e2e8f0 !important;
    border-left: 4.5px solid #94a3b8 !important;
    opacity: 0.65;
    text-decoration: line-through;
}

/* Date Toolbar Group */
.date-nav-group .btn {
    border-color: #e2e8f0;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
}
.date-nav-group .btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}
.date-nav-group .btn.active-today {
    background: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

/* KPI Cards */
.kpi-modern-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 14px 18px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.kpi-modern-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.05);
    border-color: #dee2e6;
}
.kpi-icon-pill {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

/* Staff Sidebar Item */
.staff-nav-pill {
    border-radius: 8px !important;
    margin-bottom: 4px;
    border: 1px solid transparent !important;
    transition: all 0.15s ease;
}
.staff-nav-pill:hover {
    background: #f1f5f9;
}
.staff-nav-pill.active {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #0d6efd !important;
    box-shadow: 0 1px 4px rgba(13, 110, 253, 0.08);
}

/* Compact appointment editing on small screens without sacrificing form labels. */
@media (max-width: 575.98px) {
    #modalAppointment .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    #modalAppointment .modal-content {
        max-height: calc(100vh - 1rem);
    }

    #modalAppointment .modal-header {
        padding: 0.85rem 1rem;
    }

    #modalAppointment .appointment-modal-content {
        padding: 1rem !important;
    }

    #modalAppointment .appointment-form-row {
        --bs-gutter-x: 0.65rem;
        --bs-gutter-y: 0.8rem;
    }

    #modalAppointment .appointment-form-row > .col-6 label {
        min-height: 1.7rem;
        margin-bottom: 0.2rem;
        font-size: 0.7rem;
        line-height: 1.15;
    }

    #modalAppointment .appointment-form-row .form-control,
    #modalAppointment .appointment-form-row .form-select {
        min-height: 40px;
        padding: 0.45rem 0.6rem;
        font-size: 0.86rem;
    }

    #modalAppointment .modal-footer {
        padding: 0.75rem 1rem;
    }
}
