/* CORREÇÃO DEFINITIVA E LIMPA PARA CALENDÁRIO MOBILE - 2025 */
/* Substitui todos os outros arquivos de correção do calendário */

@media screen and (max-width: 768px) {
    /* RESET COMPLETO - Limpar tudo */
    #agenda.active .modern-calendar-container,
    #agenda.active .modern-calendar-container * {
        all: unset !important;
        box-sizing: border-box !important;
    }
    
    /* CONTAINER PRINCIPAL DO CALENDÁRIO */
    #agenda.active .modern-calendar-container {
        display: block !important;
        width: 100% !important;
        max-width: 350px !important;
        margin: 20px auto !important;
        padding: 20px !important;
        background: #ffffff !important;
        border-radius: 15px !important;
        box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
        border: 1px solid #e5e7eb !important;
        font-family: 'Inter', sans-serif !important;
        position: relative !important;
    }
    
    /* CABEÇALHO DO CALENDÁRIO */
    #agenda.active .calendar-header-modern {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 20px !important;
        padding: 0 5px !important;
        width: 100% !important;
    }
    
    /* TÍTULO DO MÊS */
    #agenda.active #currentMonth,
    #agenda.active .calendar-month-title {
        font-size: 20px !important;
        font-weight: 700 !important;
        color: #1e40af !important;
        margin: 0 !important;
        text-align: center !important;
        flex: 1 !important;
    }
    
    /* BOTÕES DE NAVEGAÇÃO */
    #agenda.active .calendar-nav-modern,
    #agenda.active #prevMonth,
    #agenda.active #nextMonth {
        width: 40px !important;
        height: 40px !important;
        background: linear-gradient(135deg, #3b82f6, #1e40af) !important;
        color: white !important;
        border: none !important;
        border-radius: 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 16px !important;
        cursor: pointer !important;
        transition: transform 0.2s ease !important;
        box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3) !important;
    }
    
    #agenda.active .calendar-nav-modern:hover {
        transform: scale(1.05) !important;
        box-shadow: 0 5px 15px rgba(59, 130, 246, 0.5) !important;
    }
    
    /* DIAS DA SEMANA */
    #agenda.active .calendar-weekdays-modern {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        gap: 2px !important;
        margin-bottom: 15px !important;
        width: 100% !important;
    }
    
    #agenda.active .weekday-modern {
        text-align: center !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        color: #6b7280 !important;
        padding: 10px 4px !important;
        background: #f8fafc !important;
        border-radius: 8px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }
    
    /* GRID DOS DIAS - ESTRUTURA PRINCIPAL */
    #agenda.active .calendar-days-modern,
    #agenda.active #calendarDays {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        grid-template-rows: repeat(6, 50px) !important;
        gap: 3px !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* CADA DIA - CÉLULAS INDIVIDUAIS */
    #agenda.active .calendar-day-modern {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 50px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        color: #374151 !important;
        background: #ffffff !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 10px !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        position: relative !important;
        box-sizing: border-box !important;
        
        /* GARANTIR QUE O NÚMERO SEJA VISÍVEL */
        text-align: center !important;
        line-height: 1 !important;
        text-rendering: optimizeLegibility !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
    }
    
    /* HOVER EFFECT */
    #agenda.active .calendar-day-modern:not(.inactive):hover {
        background: #f3f4f6 !important;
        transform: scale(1.05) !important;
        border-color: #3b82f6 !important;
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2) !important;
    }
    
    /* DIA ATUAL */
    #agenda.active .calendar-day-modern.current {
        background: linear-gradient(135deg, #3b82f6, #1e40af) !important;
        color: white !important;
        font-weight: 700 !important;
        border: 2px solid #1e40af !important;
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4) !important;
    }
    
    /* DIAS COM EVENTOS */
    #agenda.active .calendar-day-modern.event {
        background: linear-gradient(135deg, #10b981, #059669) !important;
        color: white !important;
        font-weight: 700 !important;
        border: 2px solid #059669 !important;
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4) !important;
    }
    
    /* DIAS INATIVOS (MÊS ANTERIOR/PRÓXIMO) */
    #agenda.active .calendar-day-modern.inactive {
        background: #f9fafb !important;
        color: #9ca3af !important;
        cursor: default !important;
        opacity: 0.5 !important;
    }
    
    #agenda.active .calendar-day-modern.inactive:hover {
        transform: none !important;
        background: #f9fafb !important;
        box-shadow: none !important;
    }
    
    /* RESPONSIVIDADE PARA TELAS MUITO PEQUENAS */
    @media screen and (max-width: 380px) {
        #agenda.active .modern-calendar-container {
            max-width: 100% !important;
            margin: 15px 10px !important;
            padding: 15px !important;
        }
        
        #agenda.active .calendar-days-modern,
        #agenda.active #calendarDays {
            grid-template-rows: repeat(6, 45px) !important;
            gap: 2px !important;
        }
        
        #agenda.active .calendar-day-modern {
            height: 45px !important;
            font-size: 13px !important;
        }
        
        #agenda.active .weekday-modern {
            font-size: 11px !important;
            padding: 8px 2px !important;
        }
        
        #agenda.active #currentMonth,
        #agenda.active .calendar-month-title {
            font-size: 18px !important;
        }
        
        #agenda.active .calendar-nav-modern,
        #agenda.active #prevMonth,
        #agenda.active #nextMonth {
            width: 35px !important;
            height: 35px !important;
            font-size: 14px !important;
        }
    }
}

/* DESKTOP - Garantir que não afete o desktop */
@media screen and (min-width: 769px) {
    #agenda .modern-calendar-container {
        /* Manter estilo desktop intacto */
    }
}