/* VIF Calendar Custom Styles */

.vif-fullcalendar {
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Calendar Header */
.fc-toolbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    margin-bottom: 0;
}

.fc-toolbar-title {
    font-size: 1.5rem !important;
    font-weight: 600;
    color: white !important;
}

.fc-button {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    border-radius: 6px !important;
    padding: 0.5rem 1rem !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

.fc-button:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-1px);
}

.fc-button:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5) !important;
}

.fc-button-active {
    background: rgba(255, 255, 255, 0.4) !important;
}

/* Calendar Grid */
.fc-daygrid-day {
    border: 1px solid #e5e7eb !important;
}

.fc-daygrid-day:hover {
    background-color: #f8fafc !important;
}

.fc-day-today {
    background-color: #fef3c7 !important;
}

.fc-day-today .fc-daygrid-day-number {
    background: #f59e0b;
    color: white;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Event Styles - Single Day Display */
.vif-course-event {
    border-radius: 4px !important;
    border: none !important;
    padding: 3px 6px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    margin: 1px 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    cursor: pointer !important;
}

/* Make events appear as compact dots/boxes */
.vif-course-event .fc-event-main-frame {
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
}

.vif-course-event .fc-event-title {
    font-size: 0.7rem !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 100% !important;
}

.vif-course-event .fc-event-duration {
    font-size: 0.65rem !important;
    opacity: 0.9 !important;
    line-height: 1 !important;
}

.vif-course-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

/* Course Type Colors */
.course-type-professional {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

.course-type-technical {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    color: white !important;
}

.course-type-management {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    color: white !important;
}

.course-type-safety {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%) !important;
    color: white !important;
}

.course-type-certification {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%) !important;
    color: white !important;
}

/* Default course type */
.vif-course-event:not([class*="course-type-"]) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

/* Event Content */
.fc-event-time {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 2px;
}

.fc-event-location {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 2px;
    font-style: italic;
}

/* Calendar Legend */
.calendar-legend {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.calendar-legend h3 {
    margin: 0 0 1rem 0;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: inline-block;
}

.legend-label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fc-toolbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }
    
    .fc-toolbar-title {
        font-size: 1.2rem !important;
    }
    
    .fc-button {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.85rem !important;
    }
    
    .legend-items {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* RTL Support */
[dir="rtl"] .legend-items {
    flex-direction: row-reverse;
}

[dir="rtl"] .legend-item {
    flex-direction: row-reverse;
}

/* Loading State */
.fc-loading {
    opacity: 0.6;
}

/* Popover Styles */
.fc-popover {
    border-radius: 8px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
}

.fc-popover-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e5e7eb !important;
    color: #374151 !important;
    font-weight: 600 !important;
}

.fc-popover-body {
    padding: 1rem !important;
}

/* Custom Event Popover */
.custom-event-popover {
    font-family: inherit;
}

.custom-event-popover h4 {
    margin: 0 0 0.5rem 0;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
}

.custom-event-popover p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.4;
}

.custom-event-popover strong {
    color: #374151;
    font-weight: 600;
}

.popover-actions {
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

.popover-actions .btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.popover-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    color: white;
    text-decoration: none;
}

.fc-toolbar {
    background: linear-gradient(135deg, #5290d6 0%, #5290d6 100%);
}

.fc-button-group button {
    margin-right: 5px !important;
}

.fc-button-group button:last-child {
    margin-right: 0px !important;
}

.popover-actions .btn {
    background: linear-gradient(135deg, #5290d6 0%, #5290d6 100%);
    border: unset;
}