/**
 * Recreation Calendar Styles
 * Custom styling for FullCalendar.js integration
 */

/* Calendar Container */
.recreation-calendar-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 30px;
}

/* FullCalendar Overrides */
.fc {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.fc-toolbar {
    margin-bottom: 1.5em;
}

.fc-toolbar-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c5aa0;
}

.fc-button {
    background: #2c5aa0;
    border: 1px solid #2c5aa0;
    border-radius: 6px;
    font-weight: 500;
    text-transform: none;
    padding: 0.375rem 0.75rem;
}

.fc-button:hover {
    background: #1e3a72;
    border-color: #1e3a72;
}

.fc-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
}

.fc-button-active {
    background: #1e3a72;
    border-color: #1e3a72;
}

/* Today button styling */
.fc-today-button {
    background: #28a745;
    border-color: #28a745;
}

.fc-today-button:hover {
    background: #218838;
    border-color: #1e7e34;
}

/* Day grid styling */
.fc-daygrid-day {
    transition: background-color 0.2s ease;
}

.fc-daygrid-day:hover {
    background-color: #f8f9fa;
}

.fc-day-today {
    background-color: rgba(44, 90, 160, 0.1) !important;
}

.fc-daygrid-day-number {
    color: #495057;
    font-weight: 500;
    padding: 4px;
}

.fc-day-today .fc-daygrid-day-number {
    color: #2c5aa0;
    font-weight: 700;
}

/* Event styling */
.fc-event {
    border: none !important;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fc-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.fc-event-title {
    font-weight: 600;
}

.fc-daygrid-event {
    margin-bottom: 2px;
}

/* More link styling */
.fc-daygrid-more-link {
    background: #6c757d;
    color: white;
    border-radius: 3px;
    font-size: 0.8rem;
    padding: 1px 4px;
    margin-top: 2px;
}

.fc-daygrid-more-link:hover {
    background: #5a6268;
    text-decoration: none;
}

/* Popover styling */
.fc-popover {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #dee2e6;
}

.fc-popover-header {
    background: #2c5aa0;
    color: white;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
}

/* Loading indicator */
#calendar-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* Upcoming Events Sidebar */
.upcoming-events-widget {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.upcoming-event {
    transition: transform 0.2s ease;
    cursor: pointer;
}

.upcoming-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Event Details Modal */
.modal-header.bg-primary {
    border-bottom: none;
}

.event-details-icon {
    width: 20px;
    text-align: center;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        gap: 5px;
    }
    
    .fc-toolbar-title {
        font-size: 1.25rem;
        margin-bottom: 10px;
    }
    
    .fc-button {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .fc-daygrid-event {
        font-size: 0.75rem;
    }
    
    .recreation-calendar-container {
        padding: 15px;
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .fc-header-toolbar {
        flex-direction: column;
        align-items: center;
    }
    
    .fc-toolbar-title {
        font-size: 1.1rem;
        text-align: center;
    }
    
    .fc-daygrid-day-number {
        font-size: 0.9rem;
    }
    
    /* Hide weekend columns on very small screens if needed */
    .hide-weekends-mobile .fc-day-sat,
    .hide-weekends-mobile .fc-day-sun {
        display: none;
    }
}

/* Print styles */
@media print {
    .fc-button-group,
    .upcoming-events-widget {
        display: none !important;
    }
    
    .fc-event {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .recreation-calendar-container,
    .upcoming-events-widget {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .fc-daygrid-day {
        border-color: #4a5568;
    }
    
    .fc-daygrid-day-number {
        color: #e2e8f0;
    }
    
    .fc-day-today {
        background-color: rgba(44, 90, 160, 0.3) !important;
    }
}

/* Animation for calendar loading */
.calendar-fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom event color variants */
.fc-event.event-sports { background: #28a745; }
.fc-event.event-meeting { background: #2c5aa0; }
.fc-event.event-special { background: #dc3545; }
.fc-event.event-training { background: #ffc107; color: #212529; }
.fc-event.event-tournament { background: #6f42c1; }
.fc-event.event-community { background: #fd7e14; }