/* Appointments Page Styles */

.appointments-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.appointments-header {
    margin-bottom: 2rem;
}

.appointments-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 0.5rem;
}

.appointments-header .subtitle {
    font-size: 1rem;
    color: var(--text-secondary, #666);
}

/* View Tabs */
.view-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color, #e5e7eb);
    padding-bottom: 0;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary, #666);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    bottom: -2px;
}

.tab-button:hover {
    color: var(--primary-color, #3b82f6);
    background-color: var(--hover-bg, #f3f4f6);
}

.tab-button.active {
    color: var(--primary-color, #3b82f6);
    border-bottom-color: var(--primary-color, #3b82f6);
    font-weight: 600;
}

/* Filters Container */
.filters-container {
    margin-bottom: 1.5rem;
}

.filters-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.25rem;
    background-color: white;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary, #1a1a1a);
    cursor: pointer;
    transition: all 0.2s;
}

.filters-toggle:hover {
    background-color: var(--bg-secondary, #f9fafb);
    border-color: var(--primary-color, #3b82f6);
}

.filters-toggle svg:first-child {
    color: var(--primary-color, #3b82f6);
}

.filters-toggle-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.filters-toggle.active .filters-toggle-icon {
    transform: rotate(180deg);
}

.filters-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: white;
    border: 1px solid var(--border-color, #e5e7eb);
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
}

.filters-panel.active {
    max-height: 800px;
    border-top: 1px solid var(--border-color, #e5e7eb);
    margin-top: -0.5rem;
    padding-top: 0.5rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 0.875rem;
    color: var(--text-secondary, #6b7280);
    pointer-events: none;
    z-index: 1;
}

.filter-input {
    width: 100%;
    padding: 0.75rem 0.875rem 0.75rem 3rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    background-color: white;
    transition: all 0.2s;
}

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

.filter-input::placeholder {
    color: var(--text-secondary, #9ca3af);
}

.filters-actions {
    display: flex;
    gap: 1rem;
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
    margin-top: 1rem;
    padding-top: 1.5rem;
}

.filters-actions .btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

/* View Content */
.view-content {
    display: none;
}

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

/* Month Navigation */
.month-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-secondary, #f9fafb);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color, #e5e7eb);
}

.btn-month-nav {
    padding: 0.75rem 1.5rem;
    background-color: white;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.375rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary, #1a1a1a);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-month-nav:hover {
    background-color: var(--hover-bg, #f3f4f6);
    border-color: var(--primary-color, #3b82f6);
    color: var(--primary-color, #3b82f6);
}

.month-display {
    text-align: center;
}

.month-display h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin: 0 0 0.5rem 0;
}

.timezone-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Calendar Month Grid */
.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: var(--border-color, #e5e7eb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.5rem;
    overflow: hidden;
}

.calendar-month-day {
    background-color: white;
    min-height: 120px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: background-color 0.2s;
}

.calendar-month-day:hover {
    background-color: rgba(59, 130, 246, 0.02);
}

.calendar-month-day.other-month {
    background-color: var(--bg-secondary, #f9fafb);
    opacity: 0.5;
}

.calendar-month-day.today {
    background-color: rgba(59, 130, 246, 0.05);
    border: 2px solid var(--primary-color, #3b82f6);
}

.calendar-month-day.today:hover {
    background-color: rgba(59, 130, 246, 0.08);
}

.calendar-day-header {
    font-weight: 600;
    padding: 0.5rem;
    text-align: center;
    background-color: var(--bg-secondary, #f9fafb);
}

.calendar-month-day-number {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 0.5rem;
    height: 1.5rem;
    line-height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
}

.calendar-month-day.today .calendar-month-day-number {
    color: var(--primary-color, #3b82f6);
}

.calendar-month-appointments {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden; /* Changed from overflow-y: auto to prevent scrollbars */
    flex: 1;
}

.calendar-month-appointment {
    padding: 0.25rem 0.5rem;
    background-color: var(--bg-secondary, #f9fafb);
    border-left: 3px solid var(--primary-color, #3b82f6);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    min-width: 0; /* Prevent flex items from overflowing */
}

.calendar-month-appointment:hover {
    background-color: rgba(59, 130, 246, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
    z-index: 1; /* Ensure hover state appears above other elements */
}

.calendar-month-appointment:hover .calendar-month-appointment-time {
    color: var(--primary-color, #3b82f6);
}

.calendar-month-appointment:hover .calendar-month-appointment-name {
    color: var(--text-primary, #1a1a1a);
}

.calendar-month-appointment-time {
    font-weight: 600;
    color: var(--primary-color, #3b82f6);
    transition: color 0.2s;
    white-space: nowrap;
}

.calendar-month-appointment-name {
    color: var(--text-primary, #1a1a1a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s;
}

/* "+X more" indicator */
.calendar-month-more {
    padding: 0.25rem 0.5rem;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-color, #3b82f6);
    background-color: rgba(59, 130, 246, 0.05);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-month-more:hover {
    background-color: rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

/* Status-based colors for calendar appointments */
.calendar-month-appointment.status-occurred {
    border-left-color: #10b981;
    background-color: rgba(16, 185, 129, 0.05);
}

.calendar-month-appointment.status-occurred:hover {
    background-color: #10b981;
}

.calendar-month-appointment.status-cancelled,
.calendar-month-appointment.status-late-cancellation {
    border-left-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.05);
}

.calendar-month-appointment.status-cancelled:hover,
.calendar-month-appointment.status-late-cancellation:hover {
    background-color: #ef4444;
}

.calendar-month-appointment.status-no-show {
    border-left-color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.05);
}

.calendar-month-appointment.status-no-show:hover {
    background-color: #f59e0b;
}

.calendar-month-appointment.status-re-scheduled {
    border-left-color: #8b5cf6;
    background-color: rgba(139, 92, 246, 0.05);
}

.calendar-month-appointment.status-re-scheduled:hover {
    background-color: #8b5cf6;
}

/* Appointments List (for Upcoming/Past views) */
.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.appointment-card {
    background-color: white;
    border: 1px solid var(--border-color, #e5e7eb);
    border-left: 4px solid var(--primary-color, #3b82f6);
    border-radius: 0.5rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.appointment-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.appointment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.appointment-card-datetime {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.appointment-card-date {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.appointment-card-time {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color, #3b82f6);
    white-space: nowrap;
}

.appointment-card-status {
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.appointment-card-status.scheduled {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary-color, #3b82f6);
}

.appointment-card-status.occurred {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color, #10b981);
}

.appointment-card-status.cancelled,
.appointment-card-status.late-cancellation,
.appointment-card-status.rescheduled {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error-color, #ef4444);
}

.appointment-card-status.no-show {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color, #f59e0b);
}

.appointment-card-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.appointment-card-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary, #666);
}

.appointment-card-detail-icon {
    width: 20px;
    text-align: center;
}

.appointment-card-detail-label {
    font-weight: 500;
    min-width: 100px;
}

.appointment-card-detail-value {
    color: var(--text-primary, #1a1a1a);
}

/* Week Navigation */
.week-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--bg-secondary, #f9fafb);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color, #e5e7eb);
}

.btn-week-nav {
    padding: 0.75rem 1.5rem;
    background-color: white;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.375rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary, #1a1a1a);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-week-nav:hover {
    background-color: var(--hover-bg, #f3f4f6);
    border-color: var(--primary-color, #3b82f6);
    color: var(--primary-color, #3b82f6);
}

.btn-week-nav:active {
    transform: scale(0.98);
}

.week-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

#week-range-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    cursor: pointer;
    transition: color 0.2s, transform 0.1s;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    margin: 0;
}

#week-range-text:hover {
    color: var(--primary-color, #3b82f6);
    background-color: var(--hover-bg, #f3f4f6);
}

.timezone-display {
    font-size: 0.875rem;
    color: var(--text-secondary, #666);
    font-weight: 400;
    margin: 0;
    display: block;
}

.timezone-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #666);
    text-decoration: none;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color 0.2s, background-color 0.2s;
    opacity: 0.7;
}

.timezone-edit-btn:hover {
    color: var(--primary-color, #3b82f6);
    background-color: var(--hover-bg, #f3f4f6);
    opacity: 1;
}

.timezone-edit-btn svg {
    width: 16px;
    height: 16px;
}

.btn-today {
    padding: 0.375rem 1rem;
    background-color: var(--primary-color, #3b82f6);
    border: none;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-today:hover {
    background-color: var(--primary-hover, #2563eb);
}

.btn-today:active {
    transform: scale(0.98);
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.calendar-day {
    background-color: white;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.5rem;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.calendar-day.today {
    border-color: var(--primary-color, #3b82f6);
    border-width: 2px;
    box-shadow: 0 0 0 1px var(--primary-color, #3b82f6);
}

.day-header {
    padding: 0.75rem;
    background-color: var(--bg-secondary, #f9fafb);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    text-align: center;
}

.calendar-day.today .day-header {
    background-color: var(--primary-color, #3b82f6);
    color: white;
}

.day-name {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #666);
}

.calendar-day.today .day-name {
    color: white;
}

.day-date {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
    color: var(--text-primary, #1a1a1a);
}

.calendar-day.today .day-date {
    color: white;
}

.day-appointments {
    padding: 0.5rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.no-appointments {
    padding: 2rem 0.5rem;
    text-align: center;
    color: var(--text-tertiary, #9ca3af);
    font-size: 0.875rem;
}

/* Calendar Appointment Card */
.calendar-appointment {
    padding: 0.75rem;
    background-color: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-left: 3px solid var(--primary-color, #3b82f6);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-appointment:hover {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.appointment-time {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color, #3b82f6);
    margin-bottom: 0.25rem;
    white-space: nowrap;
}

.appointment-client {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appointment-type {
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status-based colors for calendar appointments */
.calendar-appointment.status-occurred {
    border-left-color: var(--success-color, #10b981);
}

.calendar-appointment.status-cancelled {
    border-left-color: var(--error-color, #ef4444);
    opacity: 0.7;
}

.calendar-appointment.status-late-cancellation {
    border-left-color: var(--error-color, #ef4444);
    opacity: 0.7;
}

.calendar-appointment.status-no-show {
    border-left-color: var(--error-color, #ef4444);
}

.calendar-appointment.status-rescheduled {
    border-left-color: var(--error-color, #ef4444);
    opacity: 0.7;
}

.calendar-appointment.status-scheduled {
    border-left-color: var(--primary-color, #3b82f6);
}

/* Strikethrough for cancelled and rescheduled appointments */
.appointment-type.cancelled,
.appointment-client.cancelled {
    text-decoration: line-through;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .calendar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .appointments-container {
        padding: 1rem;
    }
    
    .week-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-week-nav {
        width: 100%;
    }
    
    .calendar-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .calendar-day {
        min-height: auto;
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color, #e5e7eb);
    margin-bottom: 2rem;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary, #666);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-button:hover {
    color: var(--primary-color, #3b82f6);
    background-color: var(--hover-bg, #f3f4f6);
}

.tab-button.active {
    color: var(--primary-color, #3b82f6);
    border-bottom-color: var(--primary-color, #3b82f6);
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.5rem;
    background-color: var(--badge-bg, #e5e7eb);
    color: var(--text-secondary, #666);
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.tab-button.active .tab-count {
    background-color: var(--primary-color, #3b82f6);
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid var(--border-color, #e5e7eb);
    border-top-color: var(--primary-color, #3b82f6);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Appointments List */
.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Appointment Card */
.appointment-card {
    background: white;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.appointment-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.appointment-card-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.appointment-date {
    flex-shrink: 0;
    width: 4rem;
    height: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color, #3b82f6);
    color: white;
    border-radius: 0.5rem;
}

.date-day {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.date-month {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.appointment-info {
    flex: 1;
    min-width: 0;
}

.appointment-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.appointment-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin: 0;
}

.appointment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary, #666);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.meta-item svg {
    flex-shrink: 0;
}

.appointment-status {
    flex-shrink: 0;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-scheduled {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-occurred {
    background-color: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-late-cancellation {
    background-color: #fed7aa;
    color: #9a3412;
}

.status-no-show {
    background-color: #fef3c7;
    color: #92400e;
}

.status-rescheduled {
    background-color: #e0e0e0;
}

.status-default {
    background-color: #f3f4f6;
    color: #374151;
}

/* Appointment Actions */
.appointment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.appointment-actions .btn {
    text-decoration: none;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-secondary, #666);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-secondary, #666);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 0.5rem;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-secondary, #666);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary, #1a1a1a);
}

.modal-body {
    padding: 1.5rem;
}

/* Details Header */
.details-header {
    background: white;
    color: var(--text-primary, #1a1a1a);
    padding: 1.5rem;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.details-header-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.details-person-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.details-person-icon {
    font-size: 1.25rem;
    opacity: 0.9;
    color: var(--text-secondary, #666);
}

.details-person-label {
    font-weight: 500;
    opacity: 0.6;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #666);
}

.details-person-name {
    font-weight: 600;
    font-size: 1.125rem;
}

.details-header .appointment-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.details-header .appointment-links .contact-link,
.details-header .appointment-links .zoom-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.375rem;
    transition: all 0.2s;
    cursor: default;
}

.details-header .appointment-links .zoom-link:has(a) {
    cursor: pointer;
}

.details-header .appointment-links .contact-link:hover,
.details-header .appointment-links .zoom-link:has(a):hover {
    background-color: var(--bg-hover, #f3f4f6);
    border-color: var(--primary-color, #3b82f6);
}

.details-header .appointment-links a {
    color: var(--primary-color, #3b82f6);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
}

.details-header .appointment-links a:hover {
    text-decoration: underline;
}

.client-phone-label {
    font-weight: 500;
    font-size: 0.875rem;
    opacity: 0.85;
}

.client-phone-number {
    font-weight: 600;
    font-size: 0.9375rem;
}


.details-header-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.details-header-status .status-badge {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    background-color: var(--bg-secondary, #f9fafb);
    padding: 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color, #e5e7eb);
    position: relative;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: white;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color, #e5e7eb);
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-item-icon {
    font-size: 1.125rem;
    opacity: 0.7;
}

.detail-item label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.detail-item span {
    font-size: 1rem;
    color: var(--text-primary, #1a1a1a);
    font-weight: 500;
}

.details-edit-button {
    padding: 0.625rem 1rem;
    background-color: white;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #1a1a1a);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.details-edit-button.full-width {
    grid-column: 1 / -1;
    width: 100%;
}

.details-edit-button:hover {
    background-color: var(--primary-color, #3b82f6);
    color: white;
    border-color: var(--primary-color, #3b82f6);
}

.detail-item .form-control,
.detail-item input[type="date"],
.detail-item input[type="time"],
.detail-item select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: white;
}

.detail-item .form-control:focus,
.detail-item input[type="date"]:focus,
.detail-item input[type="time"]:focus,
.detail-item select:focus {
    outline: none;
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.detail-item select {
    cursor: pointer;
}

.detail-item .btn,
.detail-item button {
    align-self: center;
    width: auto !important;
}

.detail-item .btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color, #3b82f6);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
}

.detail-item .btn-link:hover {
    text-decoration: underline;
}

/* Details Actions */
.details-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 1rem;
    margin-top: 0;
}

.details-actions .btn {
    flex: 0 0 auto;
}

.details-actions .btn-danger {
    margin-right: auto;
}

.details-actions .btn-secondary,
.details-actions .btn-primary {
    min-width: 150px;
}

/* Status Form */
#status-form .form-group {
    margin-bottom: 1.5rem;
}

#status-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color, #1f2937);
}

#status-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.375rem;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

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

#status-select option {
    padding: 0.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.form-group input[type="date"],
.form-group input[type="time"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-primary {
    background-color: var(--primary-color, #3b82f6);
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: white;
    border-color: var(--border-color, #e5e7eb);
    color: var(--text-primary, #1a1a1a);
}

.btn-secondary:hover {
    background-color: #f9fafb;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.floating-alert {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1100;
    min-width: 300px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Appointment Edit Section */
.appointment-edit-section {
    background-color: var(--bg-secondary, #f9fafb);
    padding: 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color, #e5e7eb);
    margin-bottom: 1.5rem;
}

.appointment-edit-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.appointment-edit-section-title::before {
    content: '';
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 12.5C11.3807 12.5 12.5 11.3807 12.5 10C12.5 8.61929 11.3807 7.5 10 7.5C8.61929 7.5 7.5 8.61929 7.5 10C7.5 11.3807 8.61929 12.5 10 12.5Z' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M16.1667 12.5C16.0557 12.7513 16.0228 13.0302 16.0722 13.3006C16.1215 13.571 16.251 13.8203 16.4417 14.0167L16.4917 14.0667C16.6361 14.211 16.7506 14.3827 16.8286 14.5715C16.9066 14.7603 16.9467 14.9625 16.9467 15.1667C16.9467 15.3708 16.9066 15.573 16.8286 15.7618C16.7506 15.9506 16.6361 16.1223 16.4917 16.2667C16.3473 16.411 16.1756 16.5256 15.9868 16.6036C15.798 16.6816 15.5958 16.7217 15.3917 16.7217C15.1875 16.7217 14.9853 16.6816 14.7965 16.6036C14.6077 16.5256 14.436 16.411 14.2917 16.2667L14.2417 16.2167C14.0453 16.026 13.796 15.8965 13.5256 15.8471C13.2552 15.7978 12.9763 15.8307 12.725 15.9417C12.4787 16.048 12.2695 16.2254 12.1238 16.4523C11.978 16.6792 11.9017 16.9458 11.9042 17.2167V17.5C11.9042 17.9196 11.7374 18.3221 11.4405 18.619C11.1436 18.9159 10.741 19.0833 10.3213 19.0833C9.90168 19.0833 9.49915 18.9159 9.20222 18.619C8.90529 18.3221 8.73843 17.9196 8.73843 17.5V17.425C8.73044 17.1449 8.64432 16.8726 8.48984 16.6392C8.33537 16.4059 8.11875 16.221 7.86426 16.1058C7.61298 15.9948 7.33407 15.9619 7.0637 16.0113C6.79333 16.0606 6.54396 16.1901 6.34759 16.3808L6.29759 16.4308C6.15328 16.5752 5.98158 16.6897 5.79277 16.7677C5.60397 16.8457 5.40178 16.8858 5.19759 16.8858C4.9934 16.8858 4.79122 16.8457 4.60241 16.7677C4.4136 16.6897 4.2419 16.5752 4.09759 16.4308C3.95324 16.2865 3.83871 16.1148 3.76071 15.926C3.6827 15.7372 3.64258 15.535 3.64258 15.3308C3.64258 15.1267 3.6827 14.9245 3.76071 14.7357C3.83871 14.5469 3.95324 14.3752 4.09759 14.2308L4.14759 14.1808C4.33828 13.9845 4.46778 13.7351 4.51713 13.4647C4.56648 13.1944 4.53357 12.9154 4.42259 12.6642C4.31632 12.4178 4.13888 12.2086 3.912 12.0629C3.68513 11.9172 3.41847 11.8409 3.14759 11.8433H2.82093C2.40131 11.8433 1.99878 11.6765 1.70185 11.3796C1.40492 11.0827 1.23843 10.6801 1.23843 10.2605C1.23843 9.84086 1.40492 9.43833 1.70185 9.1414C1.99878 8.84447 2.40131 8.67761 2.82093 8.67761H2.89593C3.17599 8.66962 3.44827 8.5835 3.68163 8.42903C3.91499 8.27455 4.09988 8.05793 4.21509 7.80344C4.32607 7.55217 4.35898 7.27325 4.30963 7.00288C4.26028 6.73251 4.13078 6.48314 3.94009 6.28677L3.89009 6.23677C3.74574 6.09247 3.63121 5.92077 3.5532 5.73196C3.4752 5.54315 3.43508 5.34097 3.43508 5.13678C3.43508 4.93259 3.4752 4.7304 3.5532 4.54159C3.63121 4.35279 3.74574 4.18109 3.89009 4.03678C4.0344 3.89243 4.2061 3.7779 4.39491 3.69989C4.58371 3.62189 4.7859 3.58177 4.99009 3.58177C5.19428 3.58177 5.39646 3.62189 5.58527 3.69989C5.77408 3.7779 5.94578 3.89243 6.09009 4.03678L6.14009 4.08678C6.33646 4.27747 6.58583 4.40697 6.8562 4.45632C7.12657 4.50567 7.40549 4.47276 7.65676 4.36178H7.73176C7.97818 4.25551 8.18738 4.07807 8.33308 3.85119C8.47879 3.62432 8.55513 3.35766 8.55259 3.08678V2.76011C8.55259 2.34049 8.71946 1.93796 9.01639 1.64103C9.31332 1.3441 9.71585 1.17761 10.1355 1.17761C10.5551 1.17761 10.9576 1.3441 11.2545 1.64103C11.5515 1.93796 11.7184 2.34049 11.7184 2.76011V2.83511C11.7159 3.10599 11.7922 3.37265 11.9379 3.59952C12.0836 3.8264 12.2928 4.00384 12.5392 4.11011C12.7905 4.22109 13.0694 4.254 13.3398 4.20465C13.6101 4.1553 13.8595 4.0258 14.0559 3.83511L14.1059 3.78511C14.2502 3.64076 14.4219 3.52623 14.6107 3.44822C14.7995 3.37022 15.0017 3.3301 15.2059 3.3301C15.4101 3.3301 15.6123 3.37022 15.8011 3.44822C15.9899 3.52623 16.1616 3.64076 16.3059 3.78511C16.4502 3.92942 16.5648 4.10112 16.6428 4.28992C16.7208 4.47873 16.7609 4.68092 16.7609 4.88511C16.7609 5.0893 16.7208 5.29148 16.6428 5.48029C16.5648 5.66909 16.4502 5.84079 16.3059 5.98511L16.2559 6.03511C16.0652 6.23148 15.9357 6.48085 15.8863 6.75122C15.837 7.02159 15.8699 7.30051 15.9809 7.55178V7.62678C16.0871 7.8732 16.2646 8.0824 16.4914 8.22811C16.7183 8.37382 16.985 8.45015 17.2559 8.44761H17.5826C18.0022 8.44761 18.4047 8.61448 18.7016 8.91141C18.9985 9.20834 19.165 9.61087 19.165 10.0305C19.165 10.4501 18.9985 10.8526 18.7016 11.1496C18.4047 11.4465 18.0022 11.6134 17.5826 11.6134H17.5076C17.2367 11.6109 16.97 11.6872 16.7432 11.8329C16.5163 11.9786 16.3389 12.1878 16.2326 12.4342V12.5V12.5Z' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.appointment-edit-section .form-group {
    margin-bottom: 1.25rem;
}

.appointment-edit-section .form-group:last-child {
    margin-bottom: 0;
}

.appointment-edit-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.appointment-edit-section .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.appointment-edit-section .form-control:focus {
    outline: none;
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.appointment-notes-textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s;
}

.appointment-notes-textarea:focus {
    outline: none;
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.appointment-notes-textarea::placeholder {
    color: var(--text-secondary, #9ca3af);
}

/* Responsive Design */
@media (max-width: 768px) {
    .appointments-container {
        padding: 1rem;
    }

    .appointment-card-header {
        flex-direction: column;
        gap: 1rem;
    }

    .appointment-date {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 0.5rem;
    }

    .date-day {
        font-size: 1.25rem;
    }

    .appointment-actions {
        flex-direction: column;
    }

    .appointment-actions .btn {
        width: 100%;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .details-actions {
        flex-direction: column;
    }
    
    .details-actions .btn {
        width: 100%;
    }

    .modal-content {
        width: 95%;
    }

    .floating-alert {
        left: 1rem;
        right: 1rem;
        min-width: auto;
    }
}

/* Conflict Modal Styles */
.conflict-modal-content {
    max-width: 650px;
}

.conflict-warning {
    text-align: center;
}

.conflict-warning .warning-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.conflict-warning h3 {
    color: var(--error-color, #dc2626);
    margin-bottom: 1.5rem;
    font-size: 1.375rem;
    font-weight: 600;
}

.conflict-intro {
    margin-bottom: 1.25rem;
    color: var(--text-secondary, #666);
    font-size: 0.9375rem;
    text-align: left;
}

.conflict-section {
    text-align: left;
    margin-bottom: 1.25rem;
    padding: 0;
}

.conflict-section h4 {
    color: var(--text-primary, #111827);
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.conflict-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.conflict-item {
    padding: 1rem;
    margin-bottom: 0.625rem;
    background-color: #fff;
    border-radius: 0.5rem;
    border: 1.5px solid var(--border-color, #e5e7eb);
    border-left: 4px solid var(--warning-color, #f59e0b);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.conflict-item:hover {
    border-left-color: var(--warning-dark, #d97706);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

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

.conflict-item.proposed-item {
    background-color: #f0f9ff;
    border-left-color: var(--primary-color, #3b82f6);
    border-left-width: 4px;
}

.conflict-item.proposed-item:hover {
    border-left-color: var(--primary-hover, #2563eb);
}

.conflict-name {
    color: var(--text-primary, #111827);
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.conflict-name strong {
    color: var(--text-secondary, #6b7280);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.conflict-time {
    display: block;
    color: var(--text-secondary, #6b7280);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
    white-space: nowrap;
}

.conflict-item .status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    margin-top: 0.375rem;
    display: inline-block;
}

.warning-message {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background-color: #fef3c7;
    border: 1.5px solid #fbbf24;
    border-radius: 0.5rem;
    color: var(--text-primary, #111827);
    text-align: center;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.warning-message strong {
    color: var(--warning-dark, #d97706);
    font-weight: 600;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.btn-warning {
    background-color: var(--warning-color, #f59e0b);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-warning:hover {
    background-color: var(--warning-dark, #d97706);
}

.btn-warning:active {
    background-color: #b45309;
}

/* Delete option labels for recurring appointments */
.delete-option-label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-option-label:hover {
    background-color: var(--hover-bg, #f3f4f6);
    border-color: var(--primary-color, #3b82f6);
}

.delete-option-label input[type="radio"] {
    cursor: pointer;
}

.delete-option-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: var(--primary-color, #3b82f6);
}

/* Responsive adjustments for conflict modal */
@media (max-width: 768px) {
    .conflict-modal-content {
        width: 95%;
        max-width: none;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* Week Picker Modal Specific Styles */
.week-picker-content {
    max-width: 400px;
}

.week-picker-input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.375rem;
    transition: border-color 0.2s;
}

.week-picker-input:focus {
    outline: none;
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Request Change Modal Specific Styles */
.request-change-modal-content {
    max-width: 800px;
}

.request-change-intro {
    font-size: 1rem;
    color: var(--text-secondary, #666);
    margin-bottom: 2rem;
    text-align: center;
    line-height: 1.6;
}

.request-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.request-option-card {
    background-color: white;
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 0.75rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
}

.request-option-card:hover {
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.request-option-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.request-option-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin: 0 0 1rem 0;
}

.request-option-description {
    font-size: 0.9375rem;
    color: var(--text-secondary, #666);
    line-height: 1.6;
    margin: 0 0 1.25rem 0;
}

.request-option-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    width: 100%;
}

.request-option-features li {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-primary, #1a1a1a);
    text-align: left;
}

.request-option-phone {
    margin: 1rem 0 1.5rem 0;
    padding: 1.25rem;
    background-color: var(--bg-secondary, #f9fafb);
    border-radius: 0.5rem;
    width: 100%;
}

.phone-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color, #3b82f6);
    margin-bottom: 0.5rem;
    letter-spacing: 0.025em;
}

.phone-hours {
    font-size: 0.875rem;
    color: var(--text-secondary, #666);
    line-height: 1.5;
}

.request-option-btn {
    width: 100%;
    margin-top: auto;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Responsive design for request change modal */
@media (max-width: 768px) {
    .request-change-modal-content {
        width: 95%;
        max-width: none;
    }
    
    .request-options {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .request-option-card {
        padding: 1.5rem;
    }
    
    .phone-number {
        font-size: 1.25rem;
    }
}

/* Session Note Modal Specific Styles */
.modal-form-fields {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-form-fields .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-form-fields .form-group label {
    font-weight: 500;
    color: var(--text-primary, #1a1a1a);
    font-size: 0.9375rem;
}

.modal-form-fields .form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-form-fields .form-control:focus {
    outline: none;
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-form-fields .form-control:disabled {
    background-color: var(--disabled-bg, #f9fafb);
    cursor: not-allowed;
}

.modal-form-fields select.form-control {
    cursor: pointer;
}

.modal-form-fields textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Loading indicator in modal */
#sessionNoteLoadingIndicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    color: var(--text-secondary, #666);
}

#sessionNoteLoadingIndicator .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color, #e5e7eb);
    border-top-color: var(--primary-color, #3b82f6);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Linked Session Notes Section */
.linked-notes-section {
    background-color: var(--bg-secondary, #f9fafb);
    padding: 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color, #e5e7eb);
    margin-bottom: 1.5rem;
}

.linked-notes-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.linked-notes-section h4::before {
    content: '📝';
    font-size: 1.125rem;
}

.linked-notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.linked-note-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: white;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color, #e5e7eb);
    transition: all 0.2s;
}

.linked-note-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color, #3b82f6);
}

.linked-note-link {
    color: var(--primary-color, #3b82f6);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.2s;
    flex: 1;
}

.linked-note-link:hover {
    color: var(--primary-hover, #2563eb);
    text-decoration: underline;
}

.note-status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 0.25rem;
    font-weight: 500;
    white-space: nowrap;
}

.note-status-badge.status-draft {
    background-color: #e5e7eb;
    color: #374151;
}

.note-status-badge.status-signed {
    background-color: #fef3c7;
    color: #92400e;
}

.note-status-badge.status-locked {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Day View Modal (Centered) */
.day-view-modal {
    align-items: center;
    justify-content: center;
}

.day-view-panel {
    background-color: white;
    width: 700px;
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.2s ease-out;
    overflow: hidden;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.day-view-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-secondary, #f9fafb);
}

.day-view-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary, #1a1a1a);
}

.day-view-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.day-view-hours {
    display: flex;
    flex-direction: column;
    position: relative;
}

.day-view-hour {
    display: flex;
    min-height: 60px;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

.day-view-hour-label {
    width: 75px;
    padding: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    text-align: left;
    flex-shrink: 0;
    white-space: nowrap;
}

.day-view-hour-content {
    flex: 1;
    padding: 0.5rem;
    position: relative;
}

.day-view-appointment {
    background-color: white;
    border-left: 4px solid var(--primary-color, #3b82f6);
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.day-view-appointment:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border-left-width: 6px;
}

.day-view-appointment-time {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: var(--primary-color, #3b82f6);
    white-space: nowrap;
}

.day-view-appointment-title {
    font-size: 0.875rem;
    color: var(--text-primary, #1a1a1a);
}

.day-view-appointment-type {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.day-view-empty {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
}

/* Responsive Design for New Views */
@media (max-width: 1200px) {
    .calendar-month-grid {
        font-size: 0.875rem;
    }
    
    .calendar-month-day {
        min-height: 100px;
    }
    
    .filters-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .appointments-container {
        padding: 1rem;
    }
    
    .view-tabs {
        gap: 0.25rem;
    }
    
    .tab-button {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Mobile drawer for filters */
    .filters-panel {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        max-height: none;
        z-index: 1000;
        overflow-y: auto;
        border: none;
        border-radius: 0;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
    }
    
    .filters-panel.active {
        right: 0;
        border: none;
        margin-top: 0;
        padding-top: 0;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 1.25rem;
    }
    
    .filters-actions {
        position: sticky;
        bottom: 0;
        background-color: white;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
        padding: 1.25rem;
        margin-top: 0;
    }
    
    /* Backdrop for mobile drawer */
    .filters-panel.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .month-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-month-nav {
        width: 100%;
    }
    
    .calendar-month-grid {
        gap: 0;
        grid-template-columns: repeat(7, 1fr);
        font-size: 0.75rem;
    }
    
    .calendar-month-day {
        min-height: 80px;
        padding: 0.25rem;
    }
    
    .calendar-month-day-number {
        font-size: 0.875rem;
    }
    
    .calendar-month-appointment {
        font-size: 0.65rem;
        padding: 0.125rem 0.25rem;
    }
    
    .appointment-card {
        padding: 1rem;
    }
    
    .appointment-card-time {
        font-size: 1.125rem;
    }
    
    .appointment-card-detail {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .appointment-card-detail-label {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .calendar-day-header {
        font-size: 0.65rem;
        padding: 0.25rem;
    }
    
    .calendar-month-appointment {
        /* Visually hide appointments on small screens while keeping them accessible to screen readers */
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    
    .calendar-month-day.has-appointments::after {
        content: '';
        position: absolute;
        bottom: 4px;
        left: 50%;
        transform: translateX(-50%);
        width: 6px;
        height: 6px;
        background-color: var(--primary-color, #3b82f6);
        border-radius: 50%;
    }
    
    .calendar-month-day {
        position: relative;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary, #666);
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin: 1rem 0 0.5rem 0;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-state .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color, #e5e7eb);
    border-top-color: var(--primary-color, #3b82f6);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem auto;
}

.loading-state p {
    color: var(--text-secondary, #666);
    font-size: 1rem;
}
