/* Schedule Page Specific Styles */

/* Page Header */
.schedule-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.schedule-page-header-left h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.schedule-page-header-left p {
    color: var(--text-secondary);
    font-size: 14px;
}

.schedule-page-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-primary);
    padding: 4px;
    border-radius: var(--border-radius-sm);
}

.view-toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.view-toggle-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.view-toggle-btn:hover:not(.active) {
    color: var(--text-primary);
}

.btn-new-appointment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-new-appointment:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Schedule View Container */
.schedule-view {
    display: none;
}

.schedule-view.active {
    display: block;
}

/* ===== DAILY TIMELINE VIEW ===== */
.daily-timeline {
    margin-bottom: 24px;
}

.timeline-date-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.timeline-date-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.date-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.date-nav-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.today-badge {
    padding: 4px 12px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.timeline-container {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.timeline-slot {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.timeline-slot:last-child {
    border-bottom: none;
}

.timeline-slot:hover {
    background: rgba(0, 195, 209, 0.02);
}

.timeline-time {
    width: 100px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

.timeline-time .time-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-time .time-duration {
    font-size: 11px;
    color: var(--text-muted);
}

.timeline-content {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.timeline-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--border-radius-sm);
    border-left: 4px solid transparent;
    background: var(--bg-primary);
    transition: all 0.2s;
    cursor: pointer;
}

.timeline-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(2px);
}

.timeline-card.telehealth {
    border-left-color: var(--info);
}

.timeline-card.in-person {
    border-left-color: var(--success);
}

.timeline-card.async {
    border-left-color: #9333ea;
}

.timeline-card.current {
    background: linear-gradient(135deg, rgba(2, 123, 189, 0.06), rgba(0, 195, 209, 0.06));
    border-left-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.timeline-card-info {
    flex: 1;
}

.timeline-visit-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.timeline-visit-type.telehealth {
    background: var(--info-light);
    color: var(--info);
}

.timeline-visit-type.in-person {
    background: var(--success-light);
    color: var(--success);
}

.timeline-visit-type.async {
    background: #f3e8ff;
    color: #9333ea;
}

.timeline-patient-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-reason {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.timeline-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.timeline-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.timeline-action-btn {
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-align: center;
    text-decoration: none;
}

.timeline-action-btn.primary {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: white;
}

.timeline-action-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.timeline-action-btn.secondary {
    background: var(--bg-card);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.timeline-action-btn.secondary:hover {
    background: var(--primary);
    color: white;
}

.twin-readiness {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
}

.twin-readiness.ready {
    background: var(--success-light);
    color: var(--success);
}

.twin-readiness.needs-prep {
    background: var(--warning-light);
    color: var(--warning);
}

/* Current time marker */
.time-marker {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 0;
    z-index: 10;
}

.time-marker::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--critical);
}

.time-marker-dot {
    width: 10px;
    height: 10px;
    background: var(--critical);
    border-radius: 50%;
    flex-shrink: 0;
}

.time-marker-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--critical);
    margin-left: 8px;
    white-space: nowrap;
}

/* Empty slot */
.timeline-slot.empty .timeline-content {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

/* ===== WEEKLY VIEW ===== */
.weekly-grid {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.weekly-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--border-color);
}

.weekly-header-cell {
    padding: 12px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weekly-header-cell.today {
    color: var(--primary);
    background: rgba(0, 195, 209, 0.05);
}

.weekly-header-cell .day-number {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}

.weekly-header-cell.today .day-number {
    color: var(--primary);
}

.weekly-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: 320px;
}

.weekly-day {
    padding: 8px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.weekly-day.today {
    background: rgba(0, 195, 209, 0.03);
}

.weekly-appt {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.weekly-appt:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-sm);
}

.weekly-appt.telehealth {
    background: var(--info-light);
    border-left-color: var(--info);
    color: var(--info);
}

.weekly-appt.in-person {
    background: var(--success-light);
    border-left-color: var(--success);
    color: var(--success);
}

.weekly-appt.async {
    background: #f3e8ff;
    border-left-color: #9333ea;
    color: #9333ea;
}

.weekly-appt-time {
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.weekly-appt-name {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== TWO-COLUMN LAYOUT ===== */
.schedule-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Prep Queue */
.prep-queue-list {
    padding: 8px 24px 24px;
}

.prep-card {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    transition: all 0.2s;
}

.prep-card:last-child {
    margin-bottom: 0;
}

.prep-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.prep-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.prep-patient-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.prep-time-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-primary);
    padding: 6px 12px;
    border-radius: 6px;
}

.prep-time-badge i {
    color: var(--primary);
}

.prep-patient-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.prep-patient-condition {
    font-size: 12px;
    color: var(--text-muted);
}

.prep-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
}

.prep-status.ready {
    background: var(--success-light);
    color: var(--success);
}

.prep-status.review {
    background: var(--warning-light);
    color: var(--warning);
}

.prep-status.pending {
    background: var(--bg-primary);
    color: var(--text-muted);
}

.prep-twin-briefing {
    background: linear-gradient(135deg, rgba(0, 195, 209, 0.06), rgba(20, 83, 213, 0.06));
    border: 1px solid rgba(0, 195, 209, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.prep-twin-briefing-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.prep-twin-briefing-header i {
    color: var(--accent);
}

.prep-twin-briefing p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.prep-card-actions {
    display: flex;
    gap: 8px;
}

.prep-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.prep-btn.mark-prepped {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: white;
    border: none;
}

.prep-btn.mark-prepped:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.prep-btn.view-twin {
    background: var(--bg-card);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.prep-btn.view-twin:hover {
    background: var(--primary);
    color: white;
}

/* Schedule Intelligence */
.intelligence-list {
    padding: 8px 24px 24px;
}

.intelligence-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    margin-bottom: 10px;
    transition: all 0.2s;
}

.intelligence-item:last-child {
    margin-bottom: 0;
}

.intelligence-item:hover {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.intelligence-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.intelligence-icon.follow-up {
    background: var(--warning-light);
    color: var(--warning);
}

.intelligence-icon.urgent {
    background: var(--critical-light);
    color: var(--critical);
}

.intelligence-icon.opportunity {
    background: var(--info-light);
    color: var(--info);
}

.intelligence-icon.labs {
    background: #fef3c7;
    color: #d97706;
}

.intelligence-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.intelligence-action {
    flex-shrink: 0;
}

/* Stats Row */
.schedule-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.schedule-stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.2s;
}

.schedule-stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.schedule-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin: 0 auto 12px;
}

.schedule-stat-icon.utilization {
    background: var(--info-light);
    color: var(--info);
}

.schedule-stat-icon.duration {
    background: #f3e8ff;
    color: #9333ea;
}

.schedule-stat-icon.noshow {
    background: var(--success-light);
    color: var(--success);
}

.schedule-stat-icon.split {
    background: var(--warning-light);
    color: var(--warning);
}

.schedule-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.schedule-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.schedule-stat-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Pending Scheduling Table */
.pending-table-container {
    overflow-x: auto;
}

.pending-table {
    width: 100%;
    border-collapse: collapse;
}

.pending-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.pending-table td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.pending-table tbody tr {
    transition: background 0.15s;
}

.pending-table tbody tr:hover {
    background: var(--bg-primary);
}

.pending-table tbody tr:last-child td {
    border-bottom: none;
}

.pending-patient-cell {
    display: flex;
    flex-direction: column;
}

.pending-patient-cell .name {
    font-weight: 600;
    color: var(--text-primary);
}

.pending-patient-cell .mrn {
    font-size: 11px;
    color: var(--text-muted);
}

.reason-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.reason-badge.overdue {
    background: var(--critical-light);
    color: var(--critical);
}

.reason-badge.ai-rec {
    background: linear-gradient(135deg, rgba(0, 195, 209, 0.1), rgba(20, 83, 213, 0.1));
    color: var(--primary);
}

.reason-badge.lab-review {
    background: #fef3c7;
    color: #d97706;
}

.timeframe-badge {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.timeframe-badge.urgent {
    color: var(--critical);
    font-weight: 600;
}

.schedule-action-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: white;
}

.schedule-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Responsive */
@media (max-width: 1400px) {
    .schedule-two-col {
        grid-template-columns: 1fr;
    }

    .schedule-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .weekly-header,
    .weekly-body {
        grid-template-columns: repeat(5, 1fr);
    }

    .weekly-header-cell:nth-child(n+6),
    .weekly-day:nth-child(n+6) {
        display: none;
    }
}

@media (max-width: 1024px) {
    .schedule-page-header {
        flex-direction: column;
        gap: 16px;
    }

    .schedule-page-header-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .timeline-card {
        flex-wrap: wrap;
    }

    .timeline-card-actions {
        flex-direction: row;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .schedule-stats-grid {
        grid-template-columns: 1fr;
    }

    .timeline-time {
        width: 70px;
        padding: 12px 8px;
    }

    .timeline-content {
        padding: 12px;
    }

    .timeline-badges {
        display: none;
    }

    .weekly-header,
    .weekly-body {
        grid-template-columns: repeat(3, 1fr);
    }

    .weekly-header-cell:nth-child(n+4),
    .weekly-day:nth-child(n+4) {
        display: none;
    }

    .pending-table th:nth-child(n+4),
    .pending-table td:nth-child(n+4) {
        display: none;
    }

    .prep-twin-briefing {
        display: none;
    }
}
