/**
 * Modern Appointment Calendar Styling
 * Enhanced visual design with gradients, animations, and modern UI patterns
 */

/* Main Calendar Container */
.appointment-calendar {
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.appointment-calendar:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Calendar Inner Container */
.fc {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Header Styling */
.fc-header-toolbar {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 20px 24px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 0 !important;
    position: relative;
    z-index: 2;
}

.fc-toolbar-title {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #1e293b;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation Buttons */
.fc-button {
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    transition: all 0.2s ease !important;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 1 !important;
}

.fc-button-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
}

.fc-button-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
}

.fc-button-primary:not(:disabled):active,
.fc-button-primary:not(:disabled).fc-button-active {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%) !important;
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.6) !important;
    transform: translateY(0);
}

/* Today Button Special Styling */
.fc-today-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
}

.fc-today-button:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) !important;
}

/* View Buttons Group */
.fc-button-group {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: inline-flex;
}

.fc-button-group .fc-button {
    border-radius: 0 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
    margin: 0 !important;
}

.fc-button-group .fc-button:first-child {
    border-radius: 8px 0 0 8px !important;
}

.fc-button-group .fc-button:last-child {
    border-right: none !important;
    border-radius: 0 8px 8px 0 !important;
}

.fc-button-group .fc-button:only-child {
    border-radius: 8px !important;
}

/* Calendar Grid */
.fc-scrollgrid {
    border: none !important;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

/* Day Headers */
.fc-col-header-cell {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: none !important;
    padding: 16px 8px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #475569;
    position: relative;
}

.fc-col-header-cell::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
}

/* Day Cells */
.fc-daygrid-day,
.fc-timegrid-slot {
    border-color: #f1f5f9 !important;
    transition: background-color 0.2s ease;
}

.fc-daygrid-day:hover {
    background-color: #f8fafc !important;
}

.fc-daygrid-day-number {
    color: #64748b;
    font-weight: 600;
    font-size: 14px;
    padding: 8px;
    transition: color 0.2s ease;
}

.fc-day-today {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
    position: relative;
}

.fc-day-today::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(59, 130, 246, 0.1) 25%, transparent 25%, transparent 75%, rgba(59, 130, 246, 0.1) 75%);
    background-size: 10px 10px;
    pointer-events: none;
}

.fc-day-today .fc-daygrid-day-number {
    color: #1d4ed8;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Event Styling */
.fc-event {
    border: none !important;
    border-radius: 8px !important;
    padding: 4px 8px !important;
    margin: 2px !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.fc-event:hover {
    transform: translateY(-2px) scale(1.02);
    z-index: 10;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25) !important;
}

.fc-event-title {
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    color: inherit;
}

.fc-event-time {
    font-size: 11px;
    opacity: 0.9;
    font-weight: 500;
    color: inherit;
}

/* Status-based Event Colors - Eye-friendly pastel tones */
.fc-event.status-confirmed {
    background: linear-gradient(135deg, #86efac 0%, #4ade80 100%) !important;
    color: #14532d !important; /* Dark green text for contrast */
    border-color: #4ade80 !important;
}

.fc-event.status-cancelled {
    background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%) !important;
    color: #374151 !important; /* Dark gray text for contrast */
    border-color: #9ca3af !important;
}

.fc-event.status-completed {
    background: linear-gradient(135deg, #7dd3fc 0%, #38bdf8 100%) !important;
    color: #0c4a6e !important; /* Dark blue text for contrast */
    border-color: #38bdf8 !important;
}

.fc-event.status-rescheduled {
    background: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 100%) !important;
    color: #581c87 !important; /* Dark purple text for contrast */
    border-color: #a78bfa !important;
}

.fc-event.status-pending {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%) !important;
    color: #78350f !important; /* Dark yellow/brown text for contrast */
    border-color: #fcd34d !important;
}

/* Voice Call Event Styles */
.fc-call-event {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-color: #059669 !important;
    color: white !important;
    position: relative;
}

.fc-call-event:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    border-color: #047857 !important;
}

.fc-call-event .fc-event-title {
    font-weight: 500;
}

.fc-call-event .fc-event-time {
    opacity: 0.9;
}

/* Voice Call Status Specific Styles */
.fc-call-event.analyzed-call {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-left: 4px solid #064e3b !important;
}

.fc-call-event.pending-call {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    border-left: 4px solid #92400e !important;
}

/* Call Type Indicators */
.call-type-indicator {
    font-size: 12px;
    opacity: 0.8;
}

/* Voice Call List View Enhancements */
.fc-listWeek .fc-call-event {
    border-radius: 6px !important;
    margin-bottom: 2px !important;
    padding: 8px 12px !important;
}

.fc-listWeek .fc-call-event .fc-list-event-title {
    font-weight: 600 !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fc-listWeek .fc-call-event .fc-list-event-time {
    font-weight: 500 !important;
    opacity: 0.9;
}

/* Badge Styles for Voice Calls */
.badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
}

.badge-success {
    background-color: #10b981;
    color: white;
}

.badge-warning {
    background-color: #f59e0b;
    color: white;
}

.badge-info {
    background-color: #3b82f6;
    color: white;
}

.badge-secondary {
    background-color: #6b7280;
    color: white;
}

/* Dark mode event adjustments */
.dark .fc-event {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.dark .fc-event:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
}

.dark .fc-event-title {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Dark mode status colors - Adjusted for better visibility */
.dark .fc-event.status-confirmed {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%) !important;
    color: #f0fdf4 !important;
    border-color: #22c55e !important;
}

.dark .fc-event.status-cancelled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
    color: #f9fafb !important;
    border-color: #6b7280 !important;
}

.dark .fc-event.status-completed {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%) !important;
    color: #f0f9ff !important;
    border-color: #0ea5e9 !important;
}

.dark .fc-event.status-rescheduled {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%) !important;
    color: #faf5ff !important;
    border-color: #8b5cf6 !important;
}

.dark .fc-event.status-pending {
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%) !important;
    color: #78350f !important; /* Keep dark text for readability */
    border-color: #fbbf24 !important;
}

/* Dark Mode Voice Call Event Styles */
.dark .fc-call-event.analyzed-call {
    background: linear-gradient(135deg, #0f766e 0%, #0d4f48 100%) !important;
    border-left-color: #042f2e !important;
}

.dark .fc-call-event.pending-call {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    border-left-color: #78350f !important;
}

.dark .fc-call-event:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
}

.dark .fc-call-event .fc-event-title {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Dark Mode Badge Styles */
.dark .badge-success {
    background-color: #059669;
    color: #ecfdf5;
}

.dark .badge-warning {
    background-color: #d97706;
    color: #fffbeb;
}

.dark .badge-info {
    background-color: #2563eb;
    color: #dbeafe;
}

.dark .badge-secondary {
    background-color: #4b5563;
    color: #f9fafb;
}

/* Time Grid Styling */
.fc-timegrid-axis {
    border: none !important;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.fc-timegrid-slot-label {
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}

.fc-timegrid-divider {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: none !important;
    height: 2px;
}

/* List View Styling */
.fc-list-event {
    border-left: 4px solid #3b82f6 !important;
    border-radius: 0 8px 8px 0 !important;
    margin-bottom: 4px !important;
    background: white !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
}

/* Status-based background colors for list view rows */
.fc-list-event.status-confirmed {
    background: linear-gradient(135deg, #86efac 0%, #4ade80 100%) !important;
    border-left-color: #4ade80 !important;
    color: #14532d !important;
}

.fc-list-event.status-cancelled {
    background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%) !important;
    border-left-color: #9ca3af !important;
    color: #374151 !important;
}

.fc-list-event.status-completed {
    background: linear-gradient(135deg, #7dd3fc 0%, #38bdf8 100%) !important;
    border-left-color: #38bdf8 !important;
    color: #0c4a6e !important;
}

.fc-list-event.status-rescheduled {
    background: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 100%) !important;
    border-left-color: #a78bfa !important;
    color: #581c87 !important;
}

.fc-list-event.status-pending {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%) !important;
    border-left-color: #fcd34d !important;
    color: #78350f !important;
}

.fc-list-event:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Status-based hover effects */
.fc-list-event.status-confirmed:hover {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%) !important;
}

.fc-list-event.status-cancelled:hover {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
}

.fc-list-event.status-completed:hover {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%) !important;
}

.fc-list-event.status-rescheduled:hover {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%) !important;
}

.fc-list-event.status-pending:hover {
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%) !important;
}

.fc-list-event-time {
    color: #3b82f6 !important;
    font-weight: 600 !important;
}

/* Status-based text colors for list event time */
.fc-list-event.status-confirmed .fc-list-event-time {
    color: #14532d !important;
}

.fc-list-event.status-cancelled .fc-list-event-time {
    color: #374151 !important;
}

.fc-list-event.status-completed .fc-list-event-time {
    color: #0c4a6e !important;
}

.fc-list-event.status-rescheduled .fc-list-event-time {
    color: #581c87 !important;
}

.fc-list-event.status-pending .fc-list-event-time {
    color: #78350f !important;
}

.fc-list-event-title {
    color: #1e293b !important;
    font-weight: 600 !important;
}

/* Status-based text colors for list event title */
.fc-list-event.status-confirmed .fc-list-event-title {
    color: #14532d !important;
}

.fc-list-event.status-cancelled .fc-list-event-title {
    color: #374151 !important;
}

.fc-list-event.status-completed .fc-list-event-title {
    color: #0c4a6e !important;
}

.fc-list-event.status-rescheduled .fc-list-event-title {
    color: #581c87 !important;
}

.fc-list-event.status-pending .fc-list-event-title {
    color: #78350f !important;
}

/* Week Numbers */
.fc-daygrid-week-number {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #64748b;
    font-weight: 600;
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 11px;
}

/* More Link */
.fc-daygrid-more-link {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
    color: white !important;
    border-radius: 6px !important;
    padding: 2px 6px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.fc-daygrid-more-link:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
    transform: scale(1.05);
}

/* Popover Styling */
.fc-popover {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    background: white !important;
    backdrop-filter: blur(10px);
}

.fc-popover-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 12px 16px !important;
    border-radius: 12px 12px 0 0 !important;
}

.fc-popover-title {
    color: #1e293b !important;
    font-weight: 700 !important;
}

/* Loading State */
.fc-calendar-loading {
    position: relative;
}

.fc-calendar-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .fc-header-toolbar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .fc-toolbar-title {
        font-size: 22px !important;
    }
    
    .fc-button {
        padding: 8px 12px !important;
        font-size: 12px !important;
    }
    
    .appointment-calendar {
        margin: 0 -4px;
        border-radius: 8px;
    }
}

/* Dark Mode Support */
.dark .fc {
    background: #1e293b;
    color: #f1f5f9;
}

.dark .fc-header-toolbar {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
    border-bottom-color: #475569 !important;
    color: #f1f5f9 !important;
}

.dark .fc-header-toolbar * {
    color: #f1f5f9 !important;
}

/* Toolbar title - ensure visibility in dark mode with solid color */
.dark .fc-toolbar-title {
    color: #60a5fa !important;
    -webkit-text-fill-color: #60a5fa !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    text-shadow: 0 1px 3px rgba(96, 165, 250, 0.5) !important;
}

/* Ensure all child elements in title are visible */
.dark .fc-toolbar-title *,
.dark .fc-toolbar-title span,
.dark .fc-toolbar-title a {
    color: #60a5fa !important;
    -webkit-text-fill-color: #60a5fa !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
}

.dark .fc-toolbar-chunk {
    color: #f1f5f9 !important;
}

/* Ensure all text elements in toolbar are visible */
.dark .fc-header-toolbar button,
.dark .fc-header-toolbar .fc-button,
.dark .fc-header-toolbar span,
.dark .fc-header-toolbar div,
.dark .fc-toolbar-chunk {
    color: #f1f5f9 !important;
}

/* Fix navigation arrow buttons */
.dark .fc-button .fc-icon {
    color: #f1f5f9 !important;
}

/* Ensure button text in toolbar is visible */
.dark .fc-button-primary {
    color: white !important;
}

.dark .fc-button-primary .fc-icon {
    color: white !important;
}

/* Week/Month/Day view button labels */
.dark .fc-button-group .fc-button {
    color: #f1f5f9 !important;
}

.dark .fc-button-group .fc-button-active {
    color: white !important;
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%) !important;
}

.dark .fc-button-primary {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%) !important;
    color: white !important;
    border-color: #2563eb !important;
}

.dark .fc-button-primary:hover {
    background: linear-gradient(135deg, #2b77cb 0%, #2a4f7a 100%) !important;
    color: white !important;
    border-color: #1d4ed8 !important;
}

.dark .fc-button-primary:not(:disabled):active,
.dark .fc-button-primary:not(:disabled).fc-button-active {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
    color: white !important;
    border-color: #1e3a8a !important;
}

.dark .fc-today-button {
    background: linear-gradient(135deg, #0f766e 0%, #0d4f48 100%) !important;
    color: white !important;
}

.dark .fc-today-button:hover {
    background: linear-gradient(135deg, #0e6b64 0%, #0c4440 100%) !important;
}

/* Column headers (day names) - ensure visibility in dark mode */
.dark .fc-col-header-cell {
    background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
    color: #f1f5f9 !important;
    border-color: #64748b !important;
}

.dark .fc-col-header-cell::after {
    background: linear-gradient(90deg, transparent, #60a5fa, transparent) !important;
}

/* Ensure day name text is always visible */
.dark .fc-col-header-cell-cushion {
    color: #f1f5f9 !important;
}

.dark .fc-col-header-cell-cushion a {
    color: #f1f5f9 !important;
}

.dark .fc-daygrid-day,
.dark .fc-timegrid-slot {
    border-color: #475569 !important;
    background: #1e293b;
}

/* List view container - match scrollgrid-sync-inner background in dark mode */
.dark .fc-list,
.dark .fc-listWeek,
.dark .fc-listWeek-view,
.dark .fc-list-view,
.dark .fc-scrollgrid-sync-inner {
    background: #1e293b !important;
}

/* List view table and cells - inherit dark background */
.dark .fc-list table,
.dark .fc-listWeek table,
.dark .fc-list tbody,
.dark .fc-listWeek tbody {
    background: #1e293b !important;
}

.dark .fc-daygrid-day:hover {
    background-color: #334155 !important;
}

/* Date numbers - ensure visibility and contrast in dark mode */
.dark .fc-daygrid-day-number {
    color: #e2e8f0 !important;
    font-weight: 600 !important;
}

.dark .fc-daygrid-day-number a {
    color: #e2e8f0 !important;
}

.dark .fc-day-today {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%) !important;
}

.dark .fc-day-today::before {
    background: linear-gradient(45deg, rgba(96, 165, 250, 0.1) 25%, transparent 25%, transparent 75%, rgba(96, 165, 250, 0.1) 75%);
}

.dark .fc-day-today .fc-daygrid-day-number {
    color: #60a5fa;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Time grid axis (time labels) - ensure visibility */
.dark .fc-timegrid-axis {
    color: #cbd5e1 !important;
    border-color: #64748b !important;
    background: #1e293b !important;
}

.dark .fc-timegrid-axis .fc-timegrid-axis-frame {
    color: #cbd5e1 !important;
}

.dark .fc-timegrid-slot-label {
    color: #cbd5e1 !important;
    font-weight: 500 !important;
}

.dark .fc-timegrid-slot-label-cushion {
    color: #cbd5e1 !important;
}

/* Week view column headers */
.dark .fc-timegrid-col-header-cell {
    background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
    color: #f1f5f9 !important;
    border-color: #64748b !important;
}

.dark .fc-timegrid-col-header-cell-cushion {
    color: #f1f5f9 !important;
}

.dark .fc-timegrid-col-header-cell-cushion a {
    color: #f1f5f9 !important;
}

.dark .fc-timegrid-divider {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    border-color: #475569 !important;
}

/* List view events - use default/standard styling */
/* Status-based background colors for full row in dark mode */
/* Match fc-scrollgrid-sync-inner background */
.dark .fc-list-event {
    border-left: 4px solid #3b82f6 !important;
    border-radius: 0 8px 8px 0 !important;
    margin-bottom: 4px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.2s ease !important;
    padding: 8px 12px !important;
    background-color: #1e293b !important; /* Match fc-scrollgrid-sync-inner background */
}

/* Ensure all child elements inherit the row background */
.dark .fc-list-event > *,
.dark .fc-list-event td,
.dark .fc-list-event .fc-list-event-dot,
.dark .fc-list-event .fc-list-event-graphic,
.dark .fc-list-event .fc-list-event-title,
.dark .fc-list-event .fc-list-event-time,
.dark .fc-list-event .fc-list-event-marker {
    background-color: transparent !important;
}

/* Hide or style the dot to not interfere with full row background */
.dark .fc-list-event .fc-list-event-dot {
    display: none !important; /* Hide dot since we have full row color */
}

/* Dark mode status-based background colors for full list view rows */
.dark .fc-list-event.status-confirmed {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    background-color: #22c55e !important; /* Fallback solid color */
    border-left-color: #15803d !important;
    color: #f0fdf4 !important;
}

/* Ensure child elements of status-confirmed don't override background */
.dark .fc-list-event.status-confirmed > *,
.dark .fc-list-event.status-confirmed .fc-list-event-dot,
.dark .fc-list-event.status-confirmed .fc-list-event-graphic {
    background-color: transparent !important;
}

.dark .fc-list-event.status-cancelled {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
    background-color: #6b7280 !important; /* Fallback solid color */
    border-left-color: #374151 !important;
    color: #f9fafb !important;
}

.dark .fc-list-event.status-cancelled > *,
.dark .fc-list-event.status-cancelled .fc-list-event-dot,
.dark .fc-list-event.status-cancelled .fc-list-event-graphic {
    background-color: transparent !important;
}

.dark .fc-list-event.status-completed {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
    background-color: #0ea5e9 !important; /* Fallback solid color */
    border-left-color: #0369a1 !important;
    color: #ecfeff !important;
}

.dark .fc-list-event.status-completed > *,
.dark .fc-list-event.status-completed .fc-list-event-dot,
.dark .fc-list-event.status-completed .fc-list-event-graphic {
    background-color: transparent !important;
}

.dark .fc-list-event.status-rescheduled {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    background-color: #8b5cf6 !important; /* Fallback solid color */
    border-left-color: #6d28d9 !important;
    color: #faf5ff !important;
}

.dark .fc-list-event.status-rescheduled > *,
.dark .fc-list-event.status-rescheduled .fc-list-event-dot,
.dark .fc-list-event.status-rescheduled .fc-list-event-graphic {
    background-color: transparent !important;
}

.dark .fc-list-event.status-pending {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    background-color: #fbbf24 !important; /* Fallback solid color */
    border-left-color: #d97706 !important;
    color: #78350f !important;
}

.dark .fc-list-event.status-pending > *,
.dark .fc-list-event.status-pending .fc-list-event-dot,
.dark .fc-list-event.status-pending .fc-list-event-graphic {
    background-color: transparent !important;
}

/* Dark mode hover effects for list events */
.dark .fc-list-event:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.dark .fc-list-event.status-confirmed:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
}

.dark .fc-list-event.status-cancelled:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%) !important;
}

.dark .fc-list-event.status-completed:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
}

.dark .fc-list-event.status-rescheduled:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
}

.dark .fc-list-event.status-pending:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

/* Dark mode list event text colors */
.dark .fc-list-event-time {
    color: inherit !important;
    opacity: 0.9;
}

.dark .fc-list-event-title {
    color: inherit !important;
}

/* Status-specific text colors for better contrast in dark mode */
.dark .fc-list-event.status-confirmed .fc-list-event-time,
.dark .fc-list-event.status-confirmed .fc-list-event-title {
    color: #f0fdf4 !important;
}

.dark .fc-list-event.status-cancelled .fc-list-event-time,
.dark .fc-list-event.status-cancelled .fc-list-event-title {
    color: #f9fafb !important;
}

.dark .fc-list-event.status-completed .fc-list-event-time,
.dark .fc-list-event.status-completed .fc-list-event-title {
    color: #ecfeff !important;
}

.dark .fc-list-event.status-rescheduled .fc-list-event-time,
.dark .fc-list-event.status-rescheduled .fc-list-event-title {
    color: #faf5ff !important;
}

.dark .fc-list-event.status-pending .fc-list-event-time,
.dark .fc-list-event.status-pending .fc-list-event-title {
    color: #78350f !important;
}

.dark .fc-daygrid-week-number {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    color: #94a3b8;
}

/* List View Date Headers */
.fc-list-day {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    border-bottom: 2px solid #cbd5e1 !important;
    padding: 12px 16px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    color: #1e293b !important;
    margin-bottom: 8px !important;
}

.fc-list-day-text {
    font-weight: 700 !important;
    font-size: 15px !important;
    color: #1e293b !important;
}

.fc-list-day-side-text {
    font-weight: 500 !important;
    font-size: 13px !important;
    color: #64748b !important;
    margin-left: 8px !important;
}

/* List view date headers - use standard styling */
/* In dark mode, use light background for visibility */
.dark .fc-list-day {
    background: #f8fafc !important;
    border-bottom-color: #e2e8f0 !important;
    color: #1e293b !important;
}

.dark .fc-list-day-text,
.dark .fc-list-day-text a,
.dark a.fc-list-day-text {
    color: #1e293b !important;
}

.dark .fc-list-day-side-text,
.dark .fc-list-day-side-text a,
.dark a.fc-list-day-side-text {
    color: #64748b !important;
}

.dark .fc-daygrid-more-link {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%) !important;
    color: white !important;
}

.dark .fc-popover {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

.dark .fc-popover-header {
    background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
    border-bottom-color: #475569 !important;
}

.dark .fc-popover-title {
    color: #f1f5f9 !important;
}

.dark .calendar-wrapper {
    background: #1e293b !important;
    border-color: #475569 !important;
}

.dark .calendar-controls {
    background: linear-gradient(135deg, #334155 0%, #475569 100%) !important;
    border-bottom-color: #475569 !important;
    color: #f1f5f9 !important;
}

.dark .calendar-controls * {
    color: #f1f5f9 !important;
}

.dark .calendar-controls .legend span {
    color: #cbd5e1 !important;
}

.dark #refresh-countdown {
    background: #1e40af !important;
    color: #dbeafe !important;
}

.dark .calendar-controls .text-gray-500,
.dark .calendar-controls .text-gray-600 {
    color: #cbd5e1 !important;
}

.dark #calendar-current-view {
    color: #f1f5f9 !important;
}

.dark #calendar-current-view * {
    color: #f1f5f9 !important;
}

.dark #current-calendar-type {
    color: #f1f5f9 !important;
}

/* Calendar Statistics Enhancement */
.calendar-stats-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.calendar-stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transition: left 0.6s ease;
}

.calendar-stats-card:hover::before {
    left: 100%;
}

.calendar-stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

/* Enhanced Filter Controls */
.calendar-filter-section {
    background: linear-gradient(135deg, #fefefe 0%, #f8fafc 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.calendar-filter-section h2 {
    color: #1e293b;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced Select Styling */
.calendar-select {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    background: white;
    transition: all 0.3s ease;
    font-weight: 500;
}

.calendar-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Pulse Animation for Loading */
.calendar-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

/* Fullscreen Mode */
.fullscreen-calendar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: white;
    padding: 20px;
}

.fullscreen-calendar .appointment-calendar {
    height: calc(100vh - 120px);
}

.fullscreen-calendar .fc {
    height: 100% !important;
}

/* Calendar Focus States for Accessibility */
.fc-button:focus,
.fc-event:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.dark .fc-button:focus,
.dark .fc-event:focus {
    outline-color: #60a5fa;
}

/* SVG and Icon Support */
.fc-icon,
.fc svg {
    color: currentColor !important;
    stroke: currentColor !important;
    fill: currentColor !important;
}

.dark .fc-icon,
.dark .fc svg {
    color: #f1f5f9 !important;
    stroke: #f1f5f9 !important;
    fill: #f1f5f9 !important;
}

/* Button Icons */
.fc-button .fc-icon {
    font-size: 14px;
    vertical-align: middle;
}

.dark .fc-button .fc-icon {
    color: white !important;
}

/* Print Styles */
@media print {
    .calendar-controls,
    .calendar-wrapper {
        box-shadow: none !important;
        background: white !important;
    }
    
    .fc-button,
    .calendar-controls button {
        display: none !important;
    }
    
    .appointment-calendar {
        background: white !important;
    }
}