/*
 * Calendar Styles
 *
 * This file contains all calendar component styles including:
 * - FullCalendar customizations
 * - Calendar loading states
 * - Calendar events
 * - Dark mode calendar styles
 */

/* Calendar View */
#calendarView {
    position: relative;
}

.calendar-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    z-index: 10;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.calendar-loading.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid transparent;
    border-top: 5px solid var(--primary);
    border-right: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 24px;
    box-shadow: 0 0 10px rgba(28, 53, 94, 0.2);
}

[data-theme="dark"] .spinner {
    border-top-color: var(--accent);
    border-right-color: var(--accent);
    box-shadow: 0 0 10px rgba(255, 205, 0, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.calendar-loading p {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.3px;
}

#calendar-container {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    min-height: 600px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#calendar-container.loaded {
    opacity: 1;
    visibility: visible;
}

.fc-event {
    cursor: pointer;
}

.fc-daygrid-event {
    white-space: normal !important;
    align-items: center;
    margin-bottom: 4px !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
    border: none !important;
    transition: all 0.15s ease;
}

.fc-daygrid-event:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2) !important;
    transform: translateY(-1px) scale(1.01);
    z-index: 10;
}

.fc-event-title {
    font-size: 0.85rem;
    line-height: 1.3;
    font-weight: 500;
}

.fc-event-time {
    font-weight: 600;
    font-size: 0.8rem;
}

/* Asegurar que los eventos no se cortan */
.fc-daygrid-day-events {
    margin-top: 2px !important;
}

#calendar-auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

/* Dark Mode FullCalendar Overrides */
[data-theme="dark"] .fc {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .fc-theme-standard td,
[data-theme="dark"] .fc-theme-standard th {
    border-color: #334155;
}

[data-theme="dark"] .fc-scrollgrid {
    border-color: #334155;
}

[data-theme="dark"] .fc-col-header-cell {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="dark"] .fc-daygrid-day {
    background: var(--bg-secondary);
}

[data-theme="dark"] .fc-daygrid-day-number {
    color: var(--text-primary);
}

[data-theme="dark"] .fc-day-today {
    background: rgba(59, 90, 143, 0.15) !important;
}

[data-theme="dark"] .fc-day-past .fc-daygrid-day-number {
    color: var(--text-tertiary);
}

[data-theme="dark"] .fc-toolbar-title {
    color: var(--text-primary);
}

[data-theme="dark"] .fc-button {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

[data-theme="dark"] .fc-button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

[data-theme="dark"] .fc-button-active {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

[data-theme="dark"] .fc-button:disabled {
    opacity: 0.5;
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-tertiary);
}

/* List view styles for dark mode */
[data-theme="dark"] .fc-list {
    border-color: #334155;
}

[data-theme="dark"] .fc-list-event {
    cursor: pointer;
}

[data-theme="dark"] .fc-list-event:hover td {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .fc-list-event td {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: #334155;
}

[data-theme="dark"] .fc-list-day-cushion {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="dark"] .fc-list-event-dot {
    border-color: #ffffff;
}

[data-theme="dark"] .fc-list-event-time {
    color: var(--text-secondary);
}

[data-theme="dark"] .fc-list-event-title {
    color: var(--text-primary);
}

[data-theme="dark"] .fc-list-day-text,
[data-theme="dark"] .fc-list-day-side-text {
    color: var(--text-primary);
}

[data-theme="dark"] .fc-list-table td {
    border-color: #334155;
}

[data-theme="dark"] .fc-list-empty {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* Events in dark mode - better contrast */
[data-theme="dark"] .fc-event {
    border-color: transparent;
}

[data-theme="dark"] .fc-daygrid-event {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .fc-daygrid-event:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .fc-event-title {
    font-weight: 500;
}

[data-theme="dark"] .fc-daygrid-day-events {
    margin-top: 2px;
}
