/**
 * Unified Calendar Styles
 * Used across: Booking page, AV page, and Admin calendar
 * Responsive and theme-aware
 */

:root {
    --primary-color: #ff6b35;
    --secondary-color: #004e89;
    --dark-bg: #0a0a0a;
    --light-text: #f5f5f5;
    --accent-color: #ffa500;
}

/* Calendar Wrapper */
.calendar-wrapper {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.calendar-wrapper.admin-calendar {
    margin-bottom: 2rem;
}

/* Month Header */
.calendar-month-header {
    background: rgba(255, 107, 53, 0.1);
    border-bottom: 1px solid rgba(255, 107, 53, 0.2);
    padding: 1.5rem;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.month-display {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.2rem;
    flex: 1;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    background: rgba(255, 107, 53, 0.05);
}

/* Day Headers */
.day-header {
    background: rgba(255, 107, 53, 0.15);
    padding: 1rem 0.5rem;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Calendar Days */
.calendar-day {
    aspect-ratio: 1;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 107, 53, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: all 0.3s ease;
    position: relative;
    min-height: 60px;
}

.calendar-day:hover:not(.disabled):not(.unavailable) {
    background: rgba(255, 107, 53, 0.15);
    border-color: rgba(255, 107, 53, 0.4);
    transform: scale(1.02);
}

.calendar-day.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(100, 100, 100, 0.1);
}

.calendar-day.unavailable {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.3);
    cursor: not-allowed;
}

.calendar-day.unavailable::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 2px;
    background: #ff5252;
    border-radius: 1px;
}

.calendar-day.selected {
    background: linear-gradient(135deg, var(--primary-color), rgba(255, 107, 53, 0.8));
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.4);
}

.calendar-day.selected-range {
    background: rgba(255, 107, 53, 0.3);
    border-color: rgba(255, 107, 53, 0.5);
}

.calendar-day.range-start,
.calendar-day.range-end {
    background: linear-gradient(135deg, var(--primary-color), rgba(255, 107, 53, 0.8));
    border-color: var(--primary-color);
}

.calendar-day.today {
    background: rgba(255, 107, 53, 0.08);
    border: 2px solid var(--primary-color);
    box-shadow: inset 0 0 0 1px rgba(255, 107, 53, 0.3);
}

/* Day Number */
.day-num {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-color);
}

.day-number {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

/* Day Status (for booking/AV modes) */
.day-status {
    font-size: 0.65rem;
    color: #aaa;
    margin-top: auto;
    text-align: center;
}

.day-status.available {
    color: #51cf66;
    font-weight: 600;
}

.day-status.booked {
    color: #ff5252;
}

/* Calendar Events (for admin mode) */
.calendar-event {
    background: rgba(255, 107, 53, 0.15);
    border-left: 3px solid var(--primary-color);
    padding: 0.5rem 0.65rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-height: fit-content;
}

.calendar-event:hover {
    background: rgba(255, 107, 53, 0.3);
    transform: translateX(3px);
}

.calendar-event.inquiry {
    border-left-color: #0d6efd;
    background: rgba(13, 110, 253, 0.15);
}

.calendar-event.pending {
    border-left-color: #ffc107;
    background: rgba(255, 193, 7, 0.15);
}

.calendar-event.confirmed {
    border-left-color: #51cf66;
    background: rgba(81, 207, 102, 0.15);
}

.event-title {
    font-weight: 600;
    color: var(--light-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.3;
    word-break: break-word;
}

.event-customer {
    color: #aaa;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-status {
    display: inline-block;
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    border-radius: 3px;
    font-weight: 600;
    width: fit-content;
}

.status-inquiry { background: rgba(13, 110, 253, 0.2); color: #74c0fc; }
.status-pending { background: rgba(255, 193, 7, 0.2); color: #ffd166; }
.status-confirmed { background: rgba(81, 207, 102, 0.2); color: #51cf66; }

/* Responsive Design */
@media (max-width: 768px) {
    .calendar-day {
        min-height: 50px;
        font-size: 0.85rem;
    }

    .day-header {
        padding: 0.75rem 0.25rem;
        font-size: 0.7rem;
    }

    .day-num {
        font-size: 0.9rem;
    }

    .calendar-event {
        padding: 0.4rem 0.5rem;
        font-size: 0.7rem;
    }

    .event-title {
        line-height: 1.2;
    }
}

/* Accessibility */
.calendar-day:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .calendar-wrapper {
        page-break-inside: avoid;
    }
}
