/**
 * Calendar Synchronization Styles
 * Work Order #533: Calendar Synchronization UI for Meal Planning
 *
 * This stylesheet provides comprehensive styling for the calendar interface,
 * including FullCalendar customization, connection status indicators,
 * event styling, and responsive design.
 */

/* ============================================================================
   DROPDOWN STYLING
   ============================================================================ */

.dropdown-menu {
    z-index: 9999 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 15px !important;
    background: white !important;
    min-width: 200px !important;
    position: fixed !important;
}

.dropdown-item {
    padding: 0.75rem 1rem !important;
    border-radius: 8px !important;
    margin: 0.25rem !important;
    transition: all 0.2s ease !important;
    color: var(--bs-body-color) !important;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%) !important;
    color: var(--bs-primary) !important;
    transform: translateX(5px) !important;
}

.dropdown-item:focus {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%) !important;
    color: var(--bs-primary) !important;
    outline: none !important;
}

.dropdown-toggle {
    z-index: 20 !important;
    position: relative !important;
}

.btn-group {
    z-index: 20 !important;
    position: relative !important;
}

/* ============================================================================
   CALENDAR LAYOUT AND STRUCTURE
   ============================================================================ */

.calendar-header {
    background: linear-gradient(135deg, #2c5f41 0%, #4a7c59 50%, #6b9f78 100%);
    color: white;
    padding: 2rem 1.5rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(44, 95, 65, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: visible !important;
    z-index: 10 !important;
}

.calendar-header-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.calendar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.calendar-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@media (max-width: 768px) {
    .calendar-title {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .calendar-title {
        font-size: 1.75rem;
    }
}

.calendar-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.95);
    position: relative;
    z-index: 1;
    font-weight: 400;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .calendar-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .calendar-subtitle {
        font-size: 0.95rem;
    }
}

.calendar-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    position: relative;
    z-index: 20;
}

.calendar-actions .dropdown-menu {
    z-index: 9999 !important;
    position: fixed !important;
}

/* Ensure parent containers don't clip the dropdown */
.container-fluid,
.row,
.col-12 {
    overflow: visible !important;
}

.calendar-actions .btn {
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    font-size: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.calendar-actions .btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.7);
}

/* ============================================================================
   CALENDAR STATUS PANEL
   ============================================================================ */

.calendar-status-panel {
    margin-bottom: 2rem;
}

.calendar-status-panel .card {
    border: 2px solid #e0e0e0;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-radius: 25px;
    transition: all 0.3s ease;
    background: white;
    overflow: hidden;
}

.calendar-status-panel .card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border-color: #ffa726;
}

.calendar-status-panel .card-header {
    background: linear-gradient(135deg, #ffa726 0%, #ff7043 100%);
    border-bottom: none;
    border-radius: 25px 25px 0 0 !important;
    padding: 1.5rem;
    color: white;
}

.calendar-status-panel .card-title {
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ============================================================================
   CONNECTED CALENDARS LIST
   ============================================================================ */

.connection-item {
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background-color: var(--bs-body-bg);
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
}

.connection-item:hover {
    background-color: var(--bs-light);
    border-color: var(--bs-primary);
    transform: translateX(4px);
}

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

.connection-name {
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0.25rem;
}

.connection-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* ============================================================================
   SYNC STATUS INDICATORS
   ============================================================================ */

.sync-status-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.sync-status-item:last-child {
    border-bottom: none;
}

.sync-status-item .d-flex {
    align-items: center;
}

.sync-status-item span:first-child {
    font-weight: 500;
    color: var(--bs-body-color);
}

.sync-status-item .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* ============================================================================
   CALENDAR VIEW CONTROLS
   ============================================================================ */

/* Calendar Card Header */
.calendar-card-header {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 992px) {
    .calendar-card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* Calendar View Title Banner */
.calendar-view-title-banner {
    text-align: center;
    padding: 0.75rem 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 0;
}

@media (min-width: 992px) {
    .calendar-view-title-banner {
        text-align: left;
        border-bottom: none;
        padding: 0;
        margin-bottom: 0;
        flex-shrink: 0;
    }
}

.calendar-view-title-banner .card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c5f41;
    margin: 0;
}

@media (min-width: 992px) {
    .calendar-view-title-banner .card-title {
        font-size: 1.25rem;
    }
}

/* Navigation Row */
.calendar-nav-row {
    width: 100%;
    display: flex;
    justify-content: center;
    order: 1;
}

@media (min-width: 992px) {
    .calendar-nav-row {
        order: 2;
        flex: 1;
        justify-content: center;
    }
}

/* Navigation Controls */
.calendar-nav-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    justify-content: center;
}

@media (min-width: 992px) {
    .calendar-nav-controls {
        width: auto;
        max-width: none;
    }
}

/* Current Date Display */
.calendar-date-display {
    text-align: center;
    min-width: 180px;
    max-width: 280px;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    flex: 0 1 auto;
    margin: 0 0.5rem;
}

@media (max-width: 768px) {
    .calendar-date-display {
        min-width: 140px;
        max-width: 200px;
        padding: 0.4rem 0.75rem;
        margin: 0 0.25rem;
    }
}

@media (max-width: 576px) {
    .calendar-date-display {
        min-width: 120px;
        max-width: 180px;
        padding: 0.35rem 0.6rem;
        margin: 0 0.25rem;
    }
}

.calendar-current-date {
    color: #2c5f41;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
}

.calendar-date-info {
    color: #666;
    font-weight: 500;
    font-size: 0.75rem;
}

.calendar-current-date.today-indicator {
    color: var(--terracotta);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.calendar-current-date.today-indicator::after {
    content: ' (Today)';
    font-size: 0.8rem;
    color: var(--terracotta);
    font-weight: 500;
}

.btn-calendar-nav {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    border: 2px solid #4a7c59;
    background: white;
    color: #4a7c59;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-calendar-nav:hover {
    background: #4a7c59;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
    border-color: #4a7c59;
}

.btn-calendar-today {
    padding: 0.5rem 1.25rem;
    border-radius: 10px;
    border: 2px solid #ff9800;
    background: linear-gradient(135deg, #ff9800 0%, #fb8c00 100%);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.25);
}

.btn-calendar-today:hover {
    background: linear-gradient(135deg, #fb8c00 0%, #f57c00 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.35);
    color: white;
    border-color: #f57c00;
}

/* Actions Row */
.calendar-actions-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
    order: 2;
}

@media (min-width: 992px) {
    .calendar-actions-row {
        order: 3;
        width: auto;
        flex: 0 0 auto;
    }
}

/* View Type Controls */
.calendar-view-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .calendar-view-buttons {
        width: 100%;
        justify-content: center;
        gap: 0.375rem;
    }
}

.btn-calendar-view {
    padding: 0.6rem 1rem;
    border-radius: 10px;
    border: 2px solid #4a7c59;
    background: white;
    color: #4a7c59;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

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

.btn-calendar-view:hover::before {
    left: 100%;
}

.btn-calendar-view:hover {
    background: #4a7c59;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
    border-color: #4a7c59;
}

.btn-calendar-view.active {
    background: linear-gradient(135deg, #4a7c59 0%, #2c5f41 100%);
    color: white;
    border-color: #2c5f41;
    box-shadow: 0 4px 12px rgba(44, 95, 65, 0.35);
    transform: translateY(-1px);
}

.btn-calendar-view.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: #ff9800;
    border-radius: 2px;
}

/* ============================================================================
   FULLCALENDAR CUSTOMIZATION
   ============================================================================ */

/* Week View Styling */
.fc-timegrid-slot {
    border-color: rgba(74, 112, 72, 0.2);
}

.fc-timegrid-slot-label {
    color: var(--foliage-green);
    font-weight: 600;
}

.fc-timegrid-axis {
    border-color: rgba(74, 112, 72, 0.3);
}

.fc-timegrid-event {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fc-timegrid-event .fc-event-main {
    padding: 0.25rem 0.5rem;
}

.fc-timegrid-col-frame {
    border-color: rgba(74, 112, 72, 0.2);
}

.fc-timegrid-now-indicator-line {
    border-color: var(--terracotta);
    border-width: 2px;
}

.fc-timegrid-now-indicator-arrow {
    border-color: var(--terracotta);
}

.calendar-container {
    min-height: 600px;
    padding: 1rem;
}

/* FullCalendar wrapper */
.fc {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    background: white;
}

/* Calendar header */
.fc-header-toolbar {
    background: #f5f5f5;
    padding: 1rem;
    margin-bottom: 0;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
}

.fc-toolbar-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.fc-button {
    background: white;
    border: 1px solid #4a7c59;
    color: #4a7c59;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    padding: 0.5rem 1rem;
}

.fc-button:hover {
    background: #4a7c59;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 124, 89, 0.25);
    border-color: #4a7c59;
}

.fc-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

.fc-button:disabled {
    background-color: var(--bs-secondary);
    border-color: var(--bs-secondary);
    opacity: 0.6;
}

/* Calendar grid - day cells: allow events to stack and show content */
.fc-daygrid-day {
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    background: white;
}

.fc-daygrid-day-events {
    min-height: 0;
}

.fc-daygrid-day:hover {
    background: #f5f5f5;
    border-color: #bdbdbd;
}

.fc-daygrid-day.fc-day-today {
    background: #fff9e6;
    border: 2px solid #ffc107;
    box-shadow: inset 0 0 0 1px rgba(255, 193, 7, 0.2);
    position: relative;
}

.fc-daygrid-day.fc-day-today::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #ffc107;
}

.fc-daygrid-day-number {
    color: var(--bs-body-color);
    font-weight: 500;
    padding: 0.5rem;
    transition: all 0.2s ease;
}

.fc-daygrid-day-number:hover {
    color: var(--bs-primary);
    transform: scale(1.1);
}

/* Day headers */
.fc-col-header-cell {
    background: linear-gradient(135deg, #2c5f41 0%, #4a7c59 100%);
    color: white;
    font-weight: 600;
    padding: 0.75rem 0.5rem;
    border: 1px solid #1a3d2a;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
}

.fc-col-header-cell-cushion {
    color: white;
    text-decoration: none;
}

/* ============================================================================
   CALENDAR EVENTS STYLING
   ============================================================================ */

/* Month view: allow event text to wrap and scale so meal names are readable */
.fc-daygrid-event {
    white-space: normal !important;
    align-items: flex-start !important;
}

.fc-daygrid-event .fc-event-main {
    padding: 0.2rem 0.4rem;
    overflow: hidden;
    min-height: 1.5em;
}

.fc-daygrid-event .fc-event-time,
.fc-daygrid-event .fc-event-title {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: break-word;
    font-size: 0.7rem;
    line-height: 1.25;
    display: block;
}

.fc-daygrid-event .fc-event-time {
    font-weight: 600;
    margin-bottom: 0.1rem;
}

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

/* Ensure event harness doesn't clip wrapped text */
.fc-daygrid-event-harness {
    margin: 1px 0;
}

.calendar-event {
    border-radius: 6px;
    border: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.4rem 0.65rem;
    margin: 2px 1px;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    line-height: 1.4;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.calendar-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

/* Event type specific styling - Better contrast and visibility */
.meal-plan-event {
    background: #4a7c59;
    border-left: 4px solid #2c5f41;
    border-radius: 6px;
    color: white;
}

.meal-plan-event:hover {
    background: #3d6b4a;
    box-shadow: 0 3px 8px rgba(74, 124, 89, 0.4);
    transform: translateY(-1px);
}

.task-reminder-event {
    background: #ff9800;
    border-left: 4px solid #f57c00;
    color: white;
    border-radius: 6px;
}

.task-reminder-event:hover {
    background: #fb8c00;
    box-shadow: 0 3px 8px rgba(255, 152, 0, 0.4);
    transform: translateY(-1px);
}

.external-event {
    background: #757575;
    border-left: 4px solid #616161;
    color: white;
    border-radius: 6px;
}

.external-event:hover {
    background: #616161;
    box-shadow: 0 3px 8px rgba(117, 117, 117, 0.4);
    transform: translateY(-1px);
}

.custom-event {
    background: #2196f3;
    border-left: 4px solid #1976d2;
    color: white;
    border-radius: 6px;
}

.custom-event:hover {
    background: #1976d2;
    box-shadow: 0 3px 8px rgba(33, 150, 243, 0.4);
    transform: translateY(-1px);
}

/* Synced events indicator */
.synced-event {
    position: relative;
}

.synced-event::after {
    content: '🔗';
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 0.75rem;
    background: var(--bs-info);
    color: var(--bs-white);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Event time display */
.fc-event-time {
    font-weight: 600;
    opacity: 0.9;
}

.fc-event-title {
    font-weight: 500;
    margin-left: 0.25rem;
}

/* ============================================================================
   MODAL STYLING
   ============================================================================ */

/* ============================================================================
   EVENT MODAL STYLING - APP THEME
   ============================================================================ */

.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--foliage-green) 0%, var(--mountain-green) 100%);
    color: white;
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    padding: 1.5rem 2rem;
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(74, 112, 72, 0.9) 0%, rgba(52, 78, 65, 0.9) 100%);
    z-index: -1;
}

.modal-title {
    font-weight: 700;
    font-size: 1.3rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    margin: 0;
}

.modal-body {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    position: relative;
}

.modal-footer {
    border-top: 1px solid rgba(169, 203, 164, 0.3);
    padding: 1.5rem 2rem;
    background: rgba(245, 232, 199, 0.8);
    border-radius: 0 0 20px 20px;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Form styling in modals */
.modal-body .form-label {
    font-weight: 600;
    color: var(--foliage-green);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-body .form-label i {
    color: var(--terracotta);
    width: 16px;
}

.modal-body .form-control,
.modal-body .form-select {
    border-radius: 12px;
    border: 2px solid var(--mountain-green);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: var(--foliage-green);
    box-shadow: 0 0 0 0.2rem rgba(74, 112, 72, 0.25);
    background: white;
    transform: translateY(-1px);
}

.modal-body .form-control-lg {
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    border-radius: 15px;
}

.modal-body .form-text {
    color: var(--terracotta);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-style: italic;
}

.modal-body .form-check-input:checked {
    background-color: var(--foliage-green);
    border-color: var(--foliage-green);
}

.modal-body .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(74, 112, 72, 0.25);
}

/* Modal buttons */
.modal-footer .btn {
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.modal-footer .btn-secondary {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border-color: rgba(108, 117, 125, 0.3);
}

.modal-footer .btn-secondary:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--foliage-green) 0%, var(--mountain-green) 100%);
    color: white;
    border-color: var(--foliage-green);
}

.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, var(--mountain-green) 0%, var(--foliage-green) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 112, 72, 0.4);
    color: white;
}

/* ============================================================================
   EVENT DETAILS MODAL
   ============================================================================ */

.event-details {
    padding: 1rem 0;
}

.event-title {
    color: var(--bs-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.event-description {
    color: var(--bs-body-color);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.event-meta {
    background-color: var(--bs-light);
    padding: 1.5rem;
    border-radius: var(--bs-border-radius);
    border: 1px solid var(--bs-border-color);
}

.event-meta strong {
    color: var(--bs-body-color);
    font-weight: 600;
}

.event-meta .text-muted {
    font-size: 0.9rem;
}

/* ============================================================================
   SYNC PROGRESS MODAL
   ============================================================================ */

#syncProgressModal .modal-content {
    border-radius: var(--bs-border-radius-lg);
}

#syncProgressModal .modal-header {
    background: linear-gradient(135deg, var(--bs-info) 0%, var(--bs-primary) 100%);
}

#syncProgressModal .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

#syncProgressModal .progress {
    height: 0.75rem;
    border-radius: var(--bs-border-radius);
    background-color: var(--bs-light);
}

#syncProgressModal .progress-bar {
    border-radius: var(--bs-border-radius);
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-info) 100%);
}

/* ============================================================================
   ALERT STYLING
   ============================================================================ */

#alertContainer .alert {
    border: none;
    border-radius: var(--bs-border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 1rem;
    animation: slideInRight 0.3s ease;
}

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

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .calendar-header {
        padding: 1.5rem 1rem;
        margin-bottom: 0.75rem;
    }

    .calendar-header-content {
        max-width: 100%;
    }

    .calendar-actions {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1rem;
        width: 100%;
    }

    .calendar-actions .btn {
        width: 100%;
        max-width: 100%;
    }

    .calendar-card-header {
        padding: 1rem;
        gap: 0.75rem;
    }

    .calendar-nav-controls {
        gap: 0.5rem;
    }

    .calendar-actions-row {
        gap: 0.75rem;
    }

    .btn-calendar-view {
        flex: 1;
        min-width: 0;
        text-align: center;
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    .btn-calendar-nav {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .btn-calendar-today {
        width: 100%;
        max-width: 100%;
    }

    .calendar-container {
        padding: 0.5rem;
    }

    .fc-toolbar {
        flex-direction: column;
        gap: 1rem;
    }

    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-footer {
        padding: 1rem 1.5rem;
    }

    .connection-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .connection-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

@media (max-width: 576px) {
    .calendar-header {
        padding: 1.25rem 1rem;
    }

    .calendar-title {
        font-size: 1.75rem;
    }

    .calendar-subtitle {
        font-size: 1rem;
    }

    .calendar-card-header {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .calendar-view-title-banner {
        padding: 0.5rem 0;
    }

    .calendar-view-title-banner .card-title {
        font-size: 1.15rem;
    }

    .calendar-nav-controls {
        gap: 0.375rem;
    }

    .calendar-actions-row {
        gap: 0.5rem;
        flex-direction: column;
    }

    .fc {
        font-size: 0.875rem;
    }

    .fc-daygrid-day-number {
        padding: 0.25rem;
        font-size: 0.875rem;
    }

    .calendar-event {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }

    /* Month view: even smaller event text on small screens so labels fit */
    .fc-daygrid-event .fc-event-time,
    .fc-daygrid-event .fc-event-title {
        font-size: 0.65rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: 15px;
    }

    .modal-header {
        padding: 1rem;
        border-radius: 15px 15px 0 0;
    }

    .modal-footer {
        padding: 1rem;
        border-radius: 0 0 15px 15px;
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .calendar-current-date {
        font-size: 0.95rem;
    }

    .calendar-date-info {
        font-size: 0.7rem;
    }

    .calendar-view-buttons {
        gap: 0.375rem;
        width: 100%;
    }

    .btn-calendar-view {
        padding: 0.45rem 0.65rem;
        font-size: 0.75rem;
        flex: 1;
        min-width: 0;
    }

    .btn-calendar-nav {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 0.75rem;
    }

    .btn-calendar-today {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        width: 100%;
    }
}

/* ============================================================================
   DARK MODE SUPPORT - DISABLED FOR CONSISTENT LIGHT THEME
   ============================================================================ */

/* Dark mode styles are disabled to maintain consistent light theme across the application */
/* If dark mode is needed in the future, uncomment the styles below */

/*
@media (prefers-color-scheme: dark) {
    .calendar-header {
        background: linear-gradient(135deg, var(--bs-dark) 0%, var(--bs-gray-800) 100%);
    }

    .calendar-status-panel .card {
        background-color: var(--bs-dark);
        border-color: var(--bs-gray-700);
    }

    .calendar-status-panel .card-header {
        background: linear-gradient(135deg, var(--bs-gray-800) 0%, var(--bs-gray-700) 100%);
        border-color: var(--bs-gray-700);
    }

    .connection-item {
        background-color: var(--bs-dark);
        border-color: var(--bs-gray-700);
    }

    .connection-item:hover {
        background-color: var(--bs-gray-800);
        border-color: var(--bs-primary);
    }

    .fc {
        background-color: var(--bs-dark);
        color: var(--bs-light);
    }

    .fc-header-toolbar {
        background: linear-gradient(135deg, var(--bs-gray-800) 0%, var(--bs-gray-700) 100%);
        border-color: var(--bs-gray-700);
    }

    .fc-toolbar-title {
        color: var(--bs-light);
    }

    .fc-daygrid-day {
        border-color: var(--bs-gray-700);
        background-color: var(--bs-dark);
    }

    .fc-daygrid-day:hover {
        background-color: var(--bs-gray-800);
    }

    .fc-daygrid-day.fc-day-today {
        background-color: rgba(var(--bs-primary-rgb), 0.2);
    }

    .fc-daygrid-day-number {
        color: var(--bs-light);
    }

    .fc-daygrid-day-number:hover {
        color: var(--bs-primary);
    }

    .fc-col-header-cell {
        background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-hover) 100%);
        border-color: var(--bs-primary);
    }

    .event-meta {
        background-color: var(--bs-gray-800);
        border-color: var(--bs-gray-700);
    }

    .modal-content {
        background-color: var(--bs-dark);
        color: var(--bs-light);
    }

    .modal-footer {
        background-color: var(--bs-gray-800);
        border-color: var(--bs-gray-700);
    }
}
*/

/* Force light theme for calendar elements */
.fc {
    background-color: var(--bs-white) !important;
    color: var(--bs-body-color) !important;
}

.fc-header-toolbar {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-color: var(--bs-border-color) !important;
}

.fc-toolbar-title {
    color: var(--bs-body-color) !important;
    font-weight: 600 !important;
}

.fc-daygrid-day {
    border-color: var(--bs-border-color) !important;
    background-color: var(--bs-white) !important;
    transition: all 0.2s ease !important;
}

.fc-daygrid-day:hover {
    background-color: #f8f9fa !important;
    transform: scale(1.02) !important;
}

.fc-daygrid-day.fc-day-today {
    background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
    border-color: var(--bs-primary) !important;
    position: relative !important;
}

.fc-daygrid-day.fc-day-today::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3px !important;
    background: linear-gradient(90deg, var(--bs-primary) 0%, var(--bs-primary-hover) 100%) !important;
}

.fc-daygrid-day-number {
    color: var(--bs-body-color) !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.fc-daygrid-day-number:hover {
    color: var(--bs-primary) !important;
    transform: scale(1.1) !important;
}

/* Enhanced calendar styling */
.fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
    color: var(--bs-primary) !important;
    font-weight: 700 !important;
}

/* Better spacing and typography */
.fc-daygrid-day-number {
    padding: 0.5rem !important;
    border-radius: 50% !important;
    width: 2rem !important;
    height: 2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0.25rem !important;
}

.fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
    background-color: var(--bs-primary) !important;
    color: white !important;
}

/* ============================================================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================================================ */

.calendar-event:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

.fc-button:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

.connection-item:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .calendar-event {
        border: 2px solid currentColor;
    }

    .connection-item {
        border: 2px solid var(--bs-border-color);
    }

    .fc-daygrid-day {
        border: 2px solid var(--bs-border-color);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .calendar-event,
    .connection-item,
    .calendar-actions .btn,
    .fc-button {
        transition: none;
    }

    .calendar-event:hover,
    .connection-item:hover,
    .calendar-actions .btn:hover {
        transform: none;
    }

    #alertContainer .alert {
        animation: none;
    }
}
