/* Calendar Page Styles */

:root {
    --teko-primary: #ff6600;
    --teko-primary-dark: #e65c00;
}

#calendar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 600px;
}

#calendar:empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

#calendar:empty::before {
    content: "Carregando calendário...";
    color: #6c757d;
    font-size: 1.2rem;
}

.fc {
    font-family: 'Poppins', sans-serif;
}

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

.fc .fc-button {
    background-color: var(--teko-primary, #ff6600);
    border-color: var(--teko-primary, #ff6600);
    font-weight: 500;
    text-transform: capitalize;
}

.fc .fc-button:hover {
    background-color: var(--teko-primary-dark, #e65c00);
    border-color: var(--teko-primary-dark, #e65c00);
}

.fc .fc-button-active {
    background-color: var(--teko-primary-dark, #e65c00) !important;
    border-color: var(--teko-primary-dark, #e65c00) !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background-color: var(--teko-primary-dark, #e65c00) !important;
    border-color: var(--teko-primary-dark, #e65c00) !important;
}

/* Calendar header cells */
.fc-col-header-cell-cushion {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 0;
}

.fc-daygrid-day-number {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    padding: 8px;
}

.fc-daygrid-day.fc-day-today {
    background-color: rgba(255, 102, 0, 0.1) !important;
}

.fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
    background-color: var(--teko-primary, #ff6600);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Event styles */
.fc-event {
    border: none !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    font-size: 0.75rem !important;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.fc-holiday {
    background-color: #dc3545 !important;
    border-left: 3px solid #a71d2a !important;
}

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

.fc-historical {
    background-color: #0dcaf0 !important;
    border-left: 3px solid #0aabb8 !important;
    color: #000 !important;
}

/* Event modal styles */
#eventModal .modal-header.bg-teko {
    background-color: var(--teko-primary, #ff6600) !important;
    border: none;
}

#eventModal .modal-title {
    font-weight: 600;
}

#eventModal .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
}

#eventModal .modal-body {
    background-color: #f8f9fa;
}

#eventModal .display-4 {
    font-size: 2.5rem;
}

#eventModal .card {
    border: none;
    border-radius: 8px;
}

#eventModal .alert {
    border: none;
    border-radius: 8px;
}

#eventModal .btn-close-white {
    filter: brightness(0) invert(1);
}

/* Date picker styling */
#datePicker {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#datePicker:focus {
    border-color: var(--teko-primary, #ff6600);
    box-shadow: 0 0 0 0.25rem rgba(255, 102, 0, 0.25);
    outline: none;
}

/* Location button styling */
#locationBtn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

#locationBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

#locationBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Location status styling */
#locationStatus {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

#locationStatus i {
    margin-right: 8px;
}

/* Weather info styling */
#weatherInfo .alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#weatherContent {
    font-size: 1rem;
}

/* Legend styling */
.card-header.bg-teko {
    background-color: var(--teko-primary, #ff6600) !important;
    border: none;
}

.card-header h5 {
    font-weight: 600;
}

.badge {
    padding: 6px 12px;
    font-weight: 500;
}

/* FullCalendar Bootstrap5 theme overrides */
.fc-theme-bootstrap5 {
    --fc-border-color: #dee2e6;
    --fc-button-bg-color: var(--teko-primary, #ff6600);
    --fc-button-border-color: var(--teko-primary, #ff6600);
    --fc-button-hover-bg-color: var(--teko-primary-dark, #e65c00);
    --fc-button-hover-border-color: var(--teko-primary-dark, #e65c00);
    --fc-button-active-bg-color: var(--teko-primary-dark, #e65c00);
    --fc-button-active-border-color: var(--teko-primary-dark, #e65c00);
    --fc-today-bg-color: rgba(255, 102, 0, 0.1);
}

.fc .fc-daygrid-day.fc-day-today {
    background-color: rgba(255, 102, 0, 0.1) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #calendar {
        padding: 10px;
    }

    .fc .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .fc .fc-toolbar-title {
        font-size: 1.2rem;
    }

    .fc-event {
        font-size: 0.65rem !important;
        padding: 1px 4px !important;
    }

    .col-md-3.mb-2 {
        margin-bottom: 0.5rem !important;
    }
}

/* Tooltip for events */
.fc-event:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
}

.fc-event:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Loading spinner animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Icon styles */
.fc-icon {
    font-family: 'fcicons' !important;
    font-display: block;
    speak: never;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Suppress font loading warnings */
@font-face {
    font-family: 'fcicons';
    src: url('data:font/ttf;charset=utf-8;base64,') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

/* Hide broken font glyph warnings */
.fc-icon-font,
.fc-icon,
[class*="fc-icon-"] {
    font-display: block !important;
    visibility: visible !important;
}

/* Smooth transitions */
.fc-day,
.fc-event,
.fc-button {
    transition: all 0.2s ease;
}

/* Focus states for accessibility */
#datePicker:focus-visible,
#locationBtn:focus-visible {
    outline: 2px solid var(--teko-primary, #ff6600);
    outline-offset: 2px;
}
