/* Eventos Calendario Widget Styles */
.eventos-calendario-widget {
    width: 100%;
    max-width: 100%;
}


/* Event Filters */
.event-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
    padding: 16px 0;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-btn {
    background: var(--filter-color, #004388);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Host Grotesk', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    position: relative;
    text-transform: capitalize;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.filter-btn:hover {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.filter-btn.active {
    opacity: 1;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Inactive filter buttons when one is active */
.event-filters.has-active .filter-btn:not(.active) {
    opacity: 0.5;
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.event-filters.has-active .filter-btn:not(.active):hover {
    opacity: 0.7;
}

.filter-btn[data-filter="all"] {
    background: #666;
}

/* Calendar Container */
.eventos-calendar {
    background: #000000;
    color: #FFFFFF;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    font-family: 'Host Grotesk', sans-serif;
    max-width: 400px;
    margin: 0 auto;
}

/* Calendar Header */
.calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn {
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-btn svg {
    width: 12px;
    height: 12px;
}

.current-month-year {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #FFFFFF;
    min-width: 140px;
    text-align: center;
}

.today-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.today-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Weekdays Header */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 4px;
}

.weekday {
    text-align: center;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    padding: 4px 2px;
    text-transform: uppercase;
}

/* Calendar Content */
.calendar-content {
    position: relative;
    min-height: 180px;
}

.calendar-content.loading {
    opacity: 0.6;
    pointer-events: none;
}

.calendar-content.loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    padding: 2px;
}

.calendar-week {
    display: contents;
}

/* Calendar Days */
.calendar-day {
    aspect-ratio: 1;
    min-height: 36px;
    max-height: 36px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.08);
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day.empty:hover {
    background: transparent;
    transform: none;
}

.calendar-day.today {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.calendar-day.today .day-number {
    font-weight: 700;
    color: #FFD700;
}

.calendar-day.has-events {
    background: rgba(255, 255, 255, 0.08);
}

.calendar-day.has-events:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Day Number */
.day-number {
    font-size: 11px;
    font-weight: 500;
    color: #FFFFFF;
    margin: 0;
    flex-shrink: 0;
    text-align: center;
    line-height: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Day Events */
.day-events {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    align-items: center;
    justify-content: center;
    max-width: 90%;
}

.day-event {
    background: #004388;
    border-radius: 50%;
    width: 6px;
    height: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    padding: 0;
    min-height: auto;
    max-height: auto;
    flex-shrink: 0;
}

.day-event:hover {
    transform: scale(1.3);
    z-index: 10;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

.day-event span {
    display: none;
}

.more-events {
    font-size: 6px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-top: 1px;
    font-weight: 400;
    width: 100%;
    line-height: 1;
}

/* Day Events Popup */
.day-events-popup {
    background: white;
    color: #333;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    min-width: 250px;
    max-width: 300px;
    z-index: 1000;
    animation: popupFadeIn 0.2s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.popup-header {
    padding: 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.popup-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    color: #333;
}

.popup-events {
    padding: 8px;
}

.popup-event {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.popup-event:hover {
    background: #f8f9fa;
}

.event-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.event-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Mobile Responsive - SIMPLE VERSION */
@media (max-width: 768px) {
    .eventos-calendar {
        padding: 16px;
        max-width: 100%;
        margin: 0;
    }
    
    .event-filters {
        justify-content: flex-start !important;
    }
}
    
    .calendar-grid {
        gap: 3px;
        padding: 3px;
    }
    
    .calendar-header {
        margin-bottom: 12px;
    }
    
    .current-month-year {
        font-size: 14px;
        min-width: 120px;
    }
    
    .nav-btn {
        width: 20px;
        height: 20px;
    }
    
    .nav-btn svg {
        width: 10px;
        height: 10px;
    }
    
    .calendar-day {
        min-height: auto;
        max-height: none;
        height: calc((100vw - 48px) / 7);
        max-height: 45px;
        padding: 2px 1px;
        border-radius: 50%;
    }
    
    .day-number {
        font-size: 11px;
        font-weight: 600;
    }
    
    .day-event {
        width: 5px;
        height: 5px;
    }
    
    .event-filters {
        gap: 6px;
        margin-top: 12px;
        padding: 10px 0;
    }
    
    .filter-btn {
        padding: 5px 10px;
        font-size: 10px;
    }
    
    .event-filters {
        justify-content: flex-start !important;
    }
    
    .day-events-popup {
        min-width: 200px;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .eventos-calendar {
        padding: 12px;
        max-width: 100%;
        margin: 0;
    }
    
    .calendar-grid {
        gap: 2px;
        padding: 2px;
    }
    
    .calendar-day {
        min-height: auto;
        max-height: none;
        height: calc((100vw - 40px) / 7);
        max-height: 50px;
        padding: 2px 1px;
        border-radius: 50%;
    }
    
    .day-number {
        font-size: 10px;
        margin-bottom: 1px;
        font-weight: 600;
    }
    
    .day-event {
        width: 4px;
        height: 4px;
    }
    
    .weekday {
        font-size: 10px;
        padding: 4px 2px;
        letter-spacing: 0;
    }
    
    .current-month-year {
        font-size: 13px;
        min-width: 100px;
    }
    
    .nav-btn {
        width: 18px;
        height: 18px;
    }
    
    .nav-btn svg {
        width: 9px;
        height: 9px;
    }
    
    .calendar-content {
        min-height: 140px;
    }
}

/* Loading Animation */
.calendar-content.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #FFFFFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Accessibility Improvements */
.calendar-day:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

.nav-btn:focus,
.today-btn:focus,
.filter-btn:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

/* Filter Label */
.date-filter-label,
.category-filter-label {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
    padding: 8px 12px;
    margin-bottom: 16px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Host Grotesk', sans-serif;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 13px;
    gap: 8px;
}

.date-filter-label .filter-content,
.category-filter-label .filter-content {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.date-filter-label .filter-icon,
.category-filter-label .filter-icon {
    width: 14px;
    height: 14px;
    opacity: 0.6;
    flex-shrink: 0;
}

.date-filter-label .filter-text,
.category-filter-label .filter-text {
    font-size: 13px;
    font-weight: 400;
    margin: 0;
    color: #555;
}

.date-filter-label .clear-filter-btn,
.category-filter-label .clear-filter-btn {
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #666;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
    padding: 0;
}

.date-filter-label .clear-filter-btn:hover,
.category-filter-label .clear-filter-btn:hover {
    background: rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.2);
    color: #333;
}

/* Responsive Filter Labels */
@media (max-width: 768px) {
    .date-filter-label,
    .category-filter-label {
        padding: 6px 10px;
        margin-bottom: 12px;
    }
    
    .date-filter-label .filter-text,
    .category-filter-label .filter-text {
        font-size: 12px;
    }
    
    .date-filter-label .clear-filter-btn,
    .category-filter-label .clear-filter-btn {
        width: 18px;
        height: 18px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .date-filter-label,
    .category-filter-label {
        padding: 6px 8px;
        margin-bottom: 10px;
    }
    
    .date-filter-label .filter-text,
    .category-filter-label .filter-text {
        font-size: 11px;
    }
    
    .date-filter-label .clear-filter-btn,
    .category-filter-label .clear-filter-btn {
        width: 16px;
        height: 16px;
        font-size: 11px;
    }
}

/* Print Styles */
@media print {
    .eventos-calendario-widget {
        page-break-inside: avoid;
    }
    
    .event-filters,
    .calendar-navigation,
    .today-btn,
    .date-filter-label,
    .category-filter-label {
        display: none;
    }
    
    .eventos-calendar {
        background: white !important;
        color: black !important;
        box-shadow: none;
    }
    
    .calendar-day {
        border: 1px solid #ddd;
        background: white !important;
    }
    
    .day-event {
        background: #f0f0f0 !important;
        color: black !important;
    }
}