/* Calendário UEBX para Elementor */
/* Cores: #001659 (azul escuro), #f3f0e9 (bege claro), #ffffff (branco) */

.uebx-calendar-wrapper {
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 100%;
    overflow: hidden;
}

/* Controles de Navegação */
.uebx-calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: #001659;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
    gap: 20px;
}

.uebx-calendar-nav {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.uebx-calendar-controls button {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.uebx-calendar-controls button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.uebx-calendar-controls button:active {
    transform: translateY(0);
}

.uebx-calendar-title {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-align: center;
    flex: 1;
    letter-spacing: -0.5px;
}

/* Container do Calendário */
.uebx-calendar-container {
    background: #ffffff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 20px rgba(0, 22, 89, 0.15);
    overflow: hidden;
}

/* Grid do Calendário */
.uebx-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    width: 100%;
}

/* Cabeçalho dos Dias da Semana */
.uebx-calendar-weekday {
    background: #f3f0e9;
    color: #001659;
    text-align: center;
    padding: 18px 8px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 2px solid #e0ddd4;
}

.uebx-weekday-short {
    display: none;
}

.uebx-weekday-full {
    display: inline;
}

/* Células dos Dias */
.uebx-calendar-day {
    min-height: 120px;
    border: 1px solid #f3f0e9;
    padding: 12px;
    background: #ffffff;
    position: relative;
    transition: all 0.3s ease;
}

.uebx-calendar-day:hover {
    background: #fafaf8;
    box-shadow: inset 0 0 0 2px #001659;
    z-index: 1;
}

.uebx-calendar-day.empty {
    background: #f3f0e9;
    cursor: default;
    opacity: 0.5;
}

.uebx-calendar-day.empty:hover {
    background: #f3f0e9;
    box-shadow: none;
}

.uebx-day-number {
    font-size: 20px;
    font-weight: 700;
    color: #001659;
    margin-bottom: 10px;
    display: block;
}

.uebx-calendar-day.today {
    background: #f3f0e9;
}

.uebx-calendar-day.today .uebx-day-number {
    background: #001659;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Eventos */
.uebx-event {
    background: #001659;
    color: #ffffff;
    padding: 10px 12px;
    margin-top: 8px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 22, 89, 0.2);
    border-left: 4px solid #f3f0e9;
}

.uebx-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 22, 89, 0.3);
    background: #002070;
}

.uebx-event-theme {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 13px;
}

.uebx-event-details {
    font-size: 11px;
    opacity: 0.95;
    line-height: 1.5;
}

.uebx-event-city,
.uebx-event-location {
    display: block;
    margin-top: 2px;
}

.uebx-event-city::before {
    content: "📍 ";
}

.uebx-event-location::before {
    content: "📌 ";
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.uebx-calendar-day {
    animation: fadeIn 0.3s ease;
}

/* Responsivo Otimizado */

/* Tablets grandes e desktops pequenos */
@media (max-width: 1024px) {
    .uebx-calendar-controls {
        padding: 20px 25px;
    }
    
    .uebx-calendar-title {
        font-size: 24px;
    }
    
    .uebx-calendar-day {
        min-height: 110px;
        padding: 10px;
    }
    
    .uebx-day-number {
        font-size: 18px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .uebx-calendar-wrapper {
        font-size: 14px;
    }
    
    .uebx-calendar-controls {
        padding: 18px 20px;
        gap: 15px;
    }
    
    .uebx-calendar-nav {
        gap: 8px;
    }
    
    .uebx-calendar-title {
        font-size: 22px;
    }
    
    .uebx-calendar-controls button {
        padding: 9px 16px;
        font-size: 13px;
    }
    
    .uebx-calendar-weekday {
        padding: 16px 6px;
        font-size: 13px;
        letter-spacing: 1px;
    }
    
    .uebx-calendar-day {
        min-height: 100px;
        padding: 10px;
    }
    
    .uebx-day-number {
        font-size: 17px;
        margin-bottom: 8px;
    }
    
    .uebx-calendar-day.today .uebx-day-number {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .uebx-event {
        padding: 9px 11px;
        font-size: 11px;
        margin-top: 7px;
    }
    
    .uebx-event-theme {
        font-size: 12px;
        margin-bottom: 3px;
    }
    
    .uebx-event-details {
        font-size: 10px;
    }
}

/* Smartphones grandes */
@media (max-width: 640px) {
    .uebx-calendar-controls {
        padding: 15px;
        gap: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .uebx-calendar-nav {
        order: 2;
        width: 100%;
        justify-content: center;
        gap: 10px;
    }
    
    .uebx-calendar-title {
        font-size: 20px;
        flex: 1 1 100%;
        order: 1;
        margin-bottom: 10px;
    }
    
    .uebx-calendar-controls button {
        padding: 10px 20px;
        font-size: 13px;
        flex: 1;
        max-width: 160px;
    }
    
    .uebx-weekday-full {
        display: none;
    }
    
    .uebx-weekday-short {
        display: inline;
    }
    
    .uebx-calendar-weekday {
        padding: 14px 5px;
        font-size: 13px;
        letter-spacing: 0;
    }
    
    .uebx-calendar-day {
        min-height: 90px;
        padding: 8px;
    }
    
    .uebx-day-number {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .uebx-calendar-day.today .uebx-day-number {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }
    
    .uebx-event {
        padding: 8px 10px;
        font-size: 11px;
        margin-top: 6px;
    }
    
    .uebx-event-theme {
        font-size: 11px;
    }
    
    .uebx-event-details {
        font-size: 10px;
    }
}

/* Smartphones médios */
@media (max-width: 480px) {
    .uebx-calendar-wrapper {
        font-size: 13px;
    }
    
    .uebx-calendar-controls {
        padding: 12px;
        gap: 10px;
        border-radius: 8px 8px 0 0;
    }
    
    .uebx-calendar-nav {
        gap: 8px;
    }
    
    .uebx-calendar-title {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .uebx-calendar-controls button {
        padding: 9px 18px;
        font-size: 12px;
    }
    
    .uebx-calendar-container {
        border-radius: 0 0 8px 8px;
    }
    
    .uebx-calendar-weekday {
        padding: 12px 4px;
        font-size: 12px;
        letter-spacing: 0;
    }
    
    .uebx-calendar-day {
        min-height: 80px;
        padding: 6px;
        border-width: 0.5px;
    }
    
    .uebx-day-number {
        font-size: 15px;
        margin-bottom: 5px;
    }
    
    .uebx-calendar-day.today .uebx-day-number {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .uebx-event {
        padding: 7px 9px;
        font-size: 10px;
        margin-top: 5px;
        border-left-width: 3px;
    }
    
    .uebx-event-theme {
        font-size: 11px;
        margin-bottom: 2px;
    }
    
    .uebx-event-details {
        font-size: 9px;
        line-height: 1.4;
    }
}

/* Smartphones pequenos */
@media (max-width: 360px) {
    .uebx-calendar-controls {
        padding: 10px;
        gap: 8px;
    }
    
    .uebx-calendar-nav {
        gap: 6px;
    }
    
    .uebx-calendar-title {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .uebx-calendar-controls button {
        padding: 8px 14px;
        font-size: 11px;
    }
    
    .uebx-calendar-weekday {
        padding: 10px 3px;
        font-size: 11px;
        letter-spacing: 0;
    }
    
    .uebx-calendar-day {
        min-height: 70px;
        padding: 5px;
    }
    
    .uebx-day-number {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .uebx-calendar-day.today .uebx-day-number {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
    
    .uebx-event {
        padding: 6px 8px;
        font-size: 9px;
        margin-top: 4px;
    }
    
    .uebx-event-theme {
        font-size: 10px;
    }
    
    .uebx-event-details {
        font-size: 8px;
    }
}

/* Modo paisagem em smartphones */
@media (max-width: 768px) and (orientation: landscape) {
    .uebx-calendar-controls {
        padding: 12px 15px;
    }
    
    .uebx-calendar-title {
        font-size: 18px;
    }
    
    .uebx-calendar-controls button {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .uebx-calendar-weekday {
        padding: 10px 4px;
        font-size: 11px;
    }
    
    .uebx-calendar-day {
        min-height: 70px;
        padding: 6px;
    }
    
    .uebx-day-number {
        font-size: 14px;
    }
    
    .uebx-event {
        padding: 6px 8px;
        font-size: 10px;
    }
}

/* Melhorias de acessibilidade e usabilidade */
@media (hover: none) and (pointer: coarse) {
    /* Dispositivos touch */
    .uebx-calendar-controls button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .uebx-calendar-day {
        cursor: default;
    }
    
    .uebx-event {
        cursor: pointer;
    }
}

/* Modal de Evento (apenas mobile) */
.uebx-event-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 22, 89, 0.8);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInModal 0.3s ease;
}

.uebx-event-modal.active {
    display: flex;
}

.uebx-modal-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 22, 89, 0.3);
    animation: slideUpModal 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.uebx-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f3f0e9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: #001659;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.uebx-modal-close:hover {
    background: #001659;
    color: #ffffff;
    transform: rotate(90deg);
}

.uebx-modal-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f0e9;
}

.uebx-modal-date {
    color: #001659;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.uebx-modal-theme {
    color: #001659;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.uebx-modal-body {
    padding: 10px 0;
}

.uebx-modal-info {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 12px;
    background: #f3f0e9;
    border-radius: 8px;
}

.uebx-modal-icon {
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.uebx-modal-text {
    flex: 1;
}

.uebx-modal-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.uebx-modal-value {
    font-size: 16px;
    color: #001659;
    font-weight: 600;
}

.uebx-modal-empty {
    text-align: center;
    padding: 30px;
    color: #999;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUpModal {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal apenas em mobile */
@media (min-width: 769px) {
    .uebx-event-modal {
        display: none !important;
    }
}

/* Ajustes do modal em telas pequenas */
@media (max-width: 480px) {
    .uebx-modal-content {
        padding: 20px;
        border-radius: 10px;
        max-height: 85vh;
    }
    
    .uebx-modal-theme {
        font-size: 20px;
    }
    
    .uebx-modal-value {
        font-size: 14px;
    }
    
    .uebx-modal-info {
        padding: 10px;
    }
}

/* Indicador visual de que o evento é clicável no mobile */
@media (max-width: 768px) {
    .uebx-event {
        position: relative;
    }
    
    .uebx-event::after {
        content: "👆";
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 14px;
        opacity: 0.6;
    }
}

/* Impressão */
@media print {
    .uebx-calendar-controls button {
        display: none;
    }
    
    .uebx-calendar-wrapper {
        box-shadow: none;
    }
    
    .uebx-calendar-day {
        page-break-inside: avoid;
    }
}
