/* Calendar Page Styles */

.calendar-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-primary);
    overflow: hidden;
}

.calendar-container .calendar-view {
    border-radius: 12px;
    margin: 8px 16px 16px 16px;
    border: 1px solid var(--border-color);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.calendar-title-section {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.calendar-title-section .page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-navigation {
    display: flex;
    align-items: center;
    gap: 16px;
}

.calendar-nav-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-hover);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: var(--primary);
    color: white;
}

.calendar-period {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 200px;
    text-align: center;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.weather-today {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-hover);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.weather-icon {
    font-size: 16px;
}

.weather-temp {
    font-weight: 500;
    color: var(--text-primary);
}

.quick-filters {
    display: flex;
    gap: 8px;
    background: var(--bg-hover);
    padding: 4px;
    border-radius: 8px;
}

.filter-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn.active {
    background: var(--primary);
    color: white;
}

.filter-btn:hover:not(.active) {
    background: var(--bg-card);
    color: var(--text-primary);
}

.draft-reservations {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.draft-reservations h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.draft-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.draft-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-hover);
    border-radius: 6px;
    font-size: 14px;
}

.draft-info {
    color: var(--text-primary);
}

.draft-action {
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
}

.draft-action:hover {
    text-decoration: underline;
}

.view-selector {
    display: flex;
    background: var(--bg-hover);
    border-radius: 8px;
    padding: 2px;
}

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

.view-btn.active {
    background: var(--primary);
    color: white;
}

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

.calendar-content {
    flex: 1;
    overflow: hidden;
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
}

.calendar-view {
    height: 100%;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Month View */
.calendar-month {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border-color);
}

.weekday {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(70px, 1fr);
    flex: 1;
    gap: 1px;
    height: 100%;
}

.calendar-day {
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 0;
}

.calendar-day:hover {
    background: var(--bg-hover);
}

.calendar-day.current-month {
    background: var(--bg-card);
}

.calendar-day.other-month {
    background: var(--bg-hover);
    opacity: 0.5;
}

.calendar-day.today {
    background: rgba(var(--primary-rgb), 0.1);
    border: 2px solid var(--primary);
}

.calendar-day.selected {
    background: var(--primary);
    color: white;
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
    position: relative;
}

.day-number-weather {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.day-number {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    background: rgba(var(--primary-rgb), 0.1);
    padding: 2px 6px;
    border-radius: 6px;
    min-width: 28px;
    text-align: center;
}

.day-weather-inline {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    background: rgba(255, 193, 7, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 500;
    min-height: 18px;
}


.day-weather-placeholder {
    font-size: 11px;
    padding: 2px 4px;
    min-height: 18px;
    visibility: hidden;
}

.alert-dot {
    width: 12px;
    height: 12px;
    background: #ff5722;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    right: 2px;
    cursor: help;
    box-shadow: 0 1px 4px rgba(255, 87, 34, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}



.groups-badge {
    background: #9c27b0;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 2px;
    width: fit-content;
    position: absolute;
    top: 4px;
    right: 4px;
}

.day-events {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
}

.day-event {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    margin-bottom: 2px;
    line-height: 1.3;
    color: white;
}

.day-event.dejeuner {
    background: #4CAF50;
}

.day-event.diner {
    background: #FF5722;
}

.day-event.covers {
    background: #2196F3;
}

/* Week View */
.calendar-week {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    flex: 1;
    height: 100%;
}

.week-day-column {
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.week-day-column.today {
    background: rgba(var(--primary-rgb), 0.05);
}

.week-day-column.weekend {
    background: rgba(128, 128, 128, 0.05);
}

.week-day-header {
    padding: 6px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-hover);
    flex-shrink: 0;
}

.week-day-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.week-day-number {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2px 0;
    background: rgba(var(--primary-rgb), 0.1);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid var(--primary);
    text-align: center;
    min-width: 36px;
}

.week-weather {
    font-size: 9px;
    color: var(--text-secondary);
}

.service-section {
    flex: 1;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.service-section.midi {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 152, 0, 0.1));
    border-left: 4px solid #FFC107;
}

.service-section.soir {
    background: linear-gradient(135deg, rgba(63, 81, 181, 0.15), rgba(103, 58, 183, 0.1));
    border-left: 4px solid #3F51B5;
}

.service-header {
    padding: 4px 6px;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.service-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}


.service-weather {
    font-size: 9px;
    color: var(--text-secondary);
}

.service-content {
    padding: 4px 6px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.service-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
    gap: 6px;
}



.service-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-bottom: 2px;
}

.large-tables,
.special-tables {
    font-size: 9px;
    font-weight: 500;
    color: white;
    background: #E91E63;
    padding: 2px 6px;
    border-radius: 3px;
    margin: 1px 0;
    display: block;
    width: fit-content;
}

.service-events {
    display: flex;
    flex-direction: column;
    gap: 1px;
}


.week-header {
    display: grid;
    grid-template-columns: 80px 1fr;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border-color);
}

.time-column {
    border-right: 1px solid var(--border-color);
}

.week-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.week-day {
    padding: 16px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
    border-right: 1px solid var(--border-color);
}

.week-content {
    flex: 1;
    overflow-y: auto;
}

/* Day View */
.calendar-day-view {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.day-summary {
    flex: 1;
    overflow-y: auto;
}

.day-summary-header {
    padding: 24px;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-summary-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.day-weather-full {
    font-size: 18px;
    color: var(--text-secondary);
}

.day-summary-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.day-summary-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.day-summary-section h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary);
}

.city-events {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.city-event {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: var(--bg-hover);
    border-radius: 6px;
}

.event-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    min-width: 60px;
}

.event-title {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.event-impact {
    font-size: 12px;
    color: var(--text-secondary);
}

.services-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-item {
    padding: 16px;
    background: var(--bg-hover);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.service-title {
    font-size: 16px;
    color: var(--text-primary);
}

.service-stats {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-header {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }
    
    .calendar-title-section {
        flex-direction: column;
        gap: 16px;
    }
    
    .calendar-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .calendar-content {
        padding: 16px;
    }
    
    .calendar-day {
        padding: 8px;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .weekday {
        padding: 12px 8px;
        font-size: 12px;
    }
}