/* Calendar Page Styles - Mobile First */

/* Calendar wrapper */
.calendar-wrapper {
    overflow: hidden;
}

/* Navigation */
.calendar-nav {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.calendar-nav .btn {
    transition: all 0.2s ease;
}

.calendar-nav .btn:hover {
    transform: translateX(2px);
}

.calendar-nav .btn:first-child:hover {
    transform: translateX(-2px);
}

/* Grid header (weekday names) */
.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.calendar-day-header {
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #495057;
}

/* Calendar grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-left: 1px solid #dee2e6;
    border-top: 1px solid #dee2e6;
}

/* Calendar cells */
.calendar-cell {
    min-height: 80px;
    padding: 0.5rem;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    background-color: #fff;
    transition: all 0.15s ease;
    cursor: default;
    position: relative;
}

.calendar-cell:hover {
    background-color: #f8f9fa;
}

.calendar-cell-inactive {
    background-color: #f8f9fa;
    opacity: 0.6;
}

.calendar-cell-inactive:hover {
    background-color: #f1f3f5;
}

.calendar-cell-today {
    background-color: #e7f1ff;
    box-shadow: inset 0 0 0 2px #0d6efd;
}

.calendar-cell-today:hover {
    background-color: #d0e3ff;
}

.calendar-cell-has-events {
    cursor: pointer;
}

.calendar-cell-has-events:hover {
    background-color: #fff3cd;
}

/* Day number */
.calendar-cell-day {
    font-weight: 600;
    font-size: 0.9rem;
    color: #212529;
    margin-bottom: 0.25rem;
}

.calendar-cell-inactive .calendar-cell-day {
    color: #adb5bd;
}

.calendar-cell-today .calendar-cell-day {
    color: #0d6efd;
    font-weight: 700;
}

/* Event dots */
.calendar-cell-events {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
}

.calendar-event-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.calendar-event-dot:hover {
    transform: scale(1.3);
}

.calendar-event-more {
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 2px;
}

/* Event type colors */
.bg-primary { background-color: #0d6efd !important; }
.bg-success { background-color: #198754 !important; }
.bg-warning { background-color: #ffc107 !important; }
.bg-info { background-color: #0dcaf0 !important; }
.bg-secondary { background-color: #6c757d !important; }
.bg-dark { background-color: #212529 !important; }

/* Legend badges */
.calendar-legend-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    cursor: default;
}

/* Events list section */
.events-list-section {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Events date group */
.events-date-group {
    scroll-margin-top: 100px;
}

.events-date-header {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 0.5rem 0;
    z-index: 10;
}

.date-badge {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Event items */
.event-item {
    transition: all 0.15s ease;
}

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

.event-title {
    font-size: 0.95rem;
    line-height: 1.4;
}

.event-title a:hover {
    text-decoration: underline !important;
}

/* Sidebar */
.calendar-sidebar {
    position: sticky;
    top: 80px;
}

.upcoming-events-section,
.stats-section {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.25rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.upcoming-event-item {
    transition: all 0.15s ease;
}

.upcoming-event-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Mobile micro calendar */
.calendar-mobile-view {
    background: #fff;
}

.micro-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.micro-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 2px;
    min-height: 44px;
    text-decoration: none;
    color: #495057;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.micro-day-empty {
    visibility: hidden;
}

.micro-day-num {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1;
}

.micro-day-today {
    background-color: #e7f1ff;
    border: 2px solid #0d6efd;
}

.micro-day-today .micro-day-num {
    color: #0d6efd;
    font-weight: 700;
}

.micro-day-has-events {
    background-color: #f8f9fa;
    cursor: pointer;
}

.micro-day-has-events:hover {
    background-color: #fff3cd;
}

.micro-day-has-events.micro-day-today {
    background-color: #d0e3ff;
}

.micro-day-dots {
    display: flex;
    gap: 2px;
    margin-top: 3px;
}

.micro-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.mobile-event-summary .btn {
    transition: all 0.15s ease;
}

.mobile-event-summary .btn:hover {
    transform: scale(1.05);
}

/* Filters section */
.calendar-filters {
    padding: 1.25rem;
}

/* Stats section */
.stat-item:last-child {
    border-bottom: none !important;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .calendar-header h1 {
        font-size: 1.5rem;
    }
    
    .calendar-legend-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
    
    .calendar-legend-badge i {
        display: none;
    }
    
    .events-list-section {
        padding: 1rem;
    }
    
    .event-item {
        padding: 0.75rem !important;
    }
    
    .event-title {
        font-size: 0.875rem;
    }
    
    .calendar-sidebar {
        position: static;
    }
    
    .date-badge {
        min-width: 50px !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .calendar-cell {
        min-height: 70px;
    }
    
    .calendar-event-dot {
        width: 7px;
        height: 7px;
    }
}

@media (min-width: 992px) {
    .calendar-cell {
        min-height: 90px;
    }
    
    .calendar-event-dot {
        width: 10px;
        height: 10px;
    }
}

/* Animation for cells with events */
@keyframes pulse-subtle {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.3);
    }
}

.calendar-cell-has-events.calendar-cell-today {
    animation: pulse-subtle 2s infinite;
}

/* Badge colors for event types */
.badge.bg-success-subtle {
    background-color: rgba(25, 135, 84, 0.15) !important;
}

/* Print styles */
@media print {
    .calendar-filters,
    .calendar-nav .btn,
    .calendar-sidebar,
    .calendar-mobile-view {
        display: none !important;
    }
    
    .calendar-grid {
        display: grid !important;
    }
    
    .calendar-cell {
        min-height: 50px;
        page-break-inside: avoid;
    }
    
    .events-date-group {
        page-break-inside: avoid;
    }
}
