/* Calendar Styles - Mobile Optimized */
.calendar-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    overflow-x: auto; /* Allow horizontal scroll on very small screens */
}

.calendar-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
}

.calendar-weekdays {
    display: flex;
    font-weight: 600;
    color: #495057;
    text-align: center;
    min-width: 100%;
}

.calendar-weekday {
    flex: 1;
    padding: 15px 5px;
    border-right: 1px solid #dee2e6;
    font-size: 14px;
    text-transform: uppercase;
    white-space: nowrap;
}

.calendar-weekday:last-child {
    border-right: none;
}

.calendar-body {
    min-height: 400px;
}

.calendar-week {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    min-width: 100%;
}

.calendar-week:last-child {
    border-bottom: none;
}

.calendar-day {
    flex: 1;
    border-right: 1px solid #dee2e6;
    min-height: 80px;
    position: relative;
    min-width: 0; /* Allow flex items to shrink */
}

.calendar-day:last-child {
    border-right: none;
}

.calendar-day-link {
    display: block;
    padding: 8px;
    height: 100%;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    position: relative;
}

.calendar-day-link:hover,
.calendar-day-link:focus {
    text-decoration: none;
    color: inherit;
}

.calendar-day-empty {
    background: #f8f9fa;
}

.calendar-day-number {
    display: block;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    line-height: 1.2;
}

.calendar-day-count {
    display: block;
    font-size: 11px;
    color: #fff;
    background: #007bff;
    padding: 2px 6px;
    border-radius: 10px;
    text-align: center;
    white-space: nowrap;
    line-height: 1.3;
    margin-top: 2px;
}

.calendar-day-count i {
    margin-right: 2px;
}

/* Day States */
.calendar-day-has-videos .calendar-day-link {
    background: #e3f2fd;
    cursor: pointer;
}

.calendar-day-has-videos .calendar-day-link:hover {
    background: #bbdefb;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.calendar-day-some-videos .calendar-day-link {
    background: #fff3e0;
}

.calendar-day-some-videos .calendar-day-count {
    background: #ff9800;
}

.calendar-day-some-videos .calendar-day-link:hover {
    background: #ffe0b2;
}

.calendar-day-many-videos .calendar-day-link {
    background: #e8f5e8;
}

.calendar-day-many-videos .calendar-day-count {
    background: #4caf50;
}

.calendar-day-many-videos .calendar-day-link:hover {
    background: #c8e6c9;
}

.calendar-day-today {
    position: relative;
}

.calendar-day-today::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #dc3545;
    z-index: 2;
}

.calendar-day-today .calendar-day-number {
    color: #dc3545;
    font-weight: 700;
}

/* Statistics */
.calendar-stats {
    margin: 30px 0;
}

.stat-box {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    background: #fff;
    border: 1px solid #dee2e6;
}

.stat-box-primary {
    border-color: #007bff;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.stat-box-success {
    border-color: #28a745;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

.stat-box-info {
    border-color: #17a2b8;
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
    color: white;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.3;
}

/* Legend */
.calendar-legend {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.calendar-legend h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #495057;
    white-space: nowrap;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-right: 8px;
    display: inline-block;
    flex-shrink: 0;
}

.legend-color-none {
    background: #fff;
    border: 1px solid #dee2e6;
}

.legend-color-few {
    background: #007bff;
}

.legend-color-some {
    background: #ff9800;
}

.legend-color-many {
    background: #4caf50;
}

.legend-color-today {
    background: #dc3545;
}

/* Navigation */
.btn-toolbar {
    margin-bottom: 10px;
}

.btn-group .btn {
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Navigation buttons */
    .btn-toolbar .btn-group {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-group .btn {
        flex: 1;
        font-size: 14px;
        padding: 10px 8px;
    }
    
    /* Calendar weekdays */
    .calendar-weekday {
        padding: 10px 2px;
        font-size: 12px;
    }
    
    /* Calendar days */
    .calendar-day {
        min-height: 70px;
    }
    
    .calendar-day-link {
        padding: 6px;
    }
    
    .calendar-day-number {
        font-size: 14px;
    }
    
    .calendar-day-count {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    /* Statistics */
    .stat-number {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    /* Legend */
    .legend-items {
        flex-direction: column;
        gap: 8px;
    }
    
    .legend-item {
        font-size: 13px;
    }
    
    /* Panel */
    .panel-body {
        padding: 15px;
    }
    
    /* Calendar container horizontal scroll */
    .calendar-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .calendar-weekdays,
    .calendar-week {
        min-width: 350px; /* Minimum width to prevent cramping */
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .panel-heading .panel-title {
        font-size: 18px;
    }
    
    .btn-group .btn {
        font-size: 13px;
        padding: 8px 6px;
    }
    
    .calendar-weekday {
        padding: 8px 1px;
        font-size: 11px;
    }
    
    .calendar-day {
        min-height: 60px;
    }
    
    .calendar-day-link {
        padding: 4px;
    }
    
    .calendar-day-number {
        font-size: 13px;
    }
    
    .calendar-day-count {
        font-size: 9px;
        padding: 1px 3px;
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .calendar-stats .row {
        margin-left: -5px;
        margin-right: -5px;
    }
    
    .calendar-stats .col-md-4 {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    .stat-box {
        padding: 15px 10px;
    }
    
    /* Horizontal scroll hint */
    .calendar-container::after {
        content: "Swipe to scroll →";
        display: block;
        text-align: center;
        font-size: 12px;
        color: #999;
        padding: 5px;
        border-top: 1px solid #eee;
    }
}