/**
 * DIA Responsive Modals Styles
 * Estilos responsivos para modales de ubicación y otros
 */

/* === MODAL RESPONSIVE === */

/* Modal base responsivo */
.dia-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.dia-modal {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dia-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--dia-card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dia-modal-title {
    font-weight: 600;
    font-size: 1.25rem;
    margin: 0;
    color: var(--dia-primary);
    display: flex;
    align-items: center;
}

.dia-modal-body {
    padding: 1.5rem;
    line-height: 1.6;
}

.dia-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--dia-card-border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

/* === RESPONSIVE BREAKPOINTS === */

/* Tablet y desktop */
@media (min-width: 768px) {
    .dia-modal {
        max-width: 600px;
    }
    
    .dia-modal-header {
        padding: 2rem;
    }
    
    .dia-modal-body {
        padding: 2rem;
    }
    
    .dia-modal-footer {
        padding: 2rem;
        flex-wrap: nowrap;
    }
}

/* Desktop grande */
@media (min-width: 992px) {
    .dia-modal {
        max-width: 700px;
    }
}

/* Móvil pequeño */
@media (max-width: 480px) {
    .dia-modal-overlay {
        padding: 0.5rem;
    }
    
    .dia-modal {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 0.75rem;
        margin: 0;
    }
    
    .dia-modal-header {
        padding: 1rem;
    }
    
    .dia-modal-body {
        padding: 1rem;
    }
    
    .dia-modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .dia-modal-footer .dia-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Ajustar contenido del modal en móvil */
    .dia-modal-body .row {
        margin: 0;
    }
    
    .dia-modal-body .col-md-4,
    .dia-modal-body .col-md-6,
    .dia-modal-body .col-lg-6 {
        margin-bottom: 1rem;
    }
    
    /* Acordeón más compacto en móvil */
    .accordion-item {
        border-radius: 0.5rem !important;
        margin-bottom: 0.5rem;
    }
    
    .accordion-button {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .accordion-body {
        padding: 1rem;
    }
}

/* === CONTENIDO ESPECÍFICO DEL MODAL DE UBICACIÓN === */

/* Iconos grandes más pequeños en móvil */
@media (max-width: 768px) {
    .dia-modal-body .display-1 {
        font-size: 3rem !important;
    }
    
    .dia-modal-body .fs-3 {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 480px) {
    .dia-modal-body .display-1 {
        font-size: 2.5rem !important;
    }
    
    .dia-modal-body .fs-3 {
        font-size: 1.25rem !important;
    }
}

/* Beneficios en cards más compactos en móvil */
@media (max-width: 768px) {
    .dia-modal-body .text-center.p-3 {
        padding: 1rem !important;
        margin-bottom: 0.75rem;
    }
    
    .dia-modal-body .bg-light {
        border-radius: 0.5rem;
    }
    
    .dia-modal-body .bg-info.bg-opacity-10,
    .dia-modal-body .bg-success.bg-opacity-10 {
        padding: 1rem !important;
        margin-bottom: 1rem;
    }
}

/* Alertas más compactas en móvil */
@media (max-width: 768px) {
    .dia-modal-body .alert {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .dia-modal-body .alert-heading {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
}

/* === MEJORAS DE ACCESIBILIDAD === */

/* Enfoque visible */
.dia-modal:focus-within {
    outline: 2px solid var(--dia-primary);
    outline-offset: 2px;
}

/* Botones más grandes en móvil para touch */
@media (max-width: 768px) {
    .dia-btn {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    .dia-btn i {
        font-size: 1.1rem;
    }
}

/* === ANIMACIONES Y TRANSICIONES === */

/* Fade in/out para overlay */
.dia-modal-overlay {
    animation: modalFadeIn 0.3s ease-out;
}

.dia-modal-overlay.closing {
    animation: modalFadeOut 0.2s ease-in;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* === DARK MODE SUPPORT === */

@media (prefers-color-scheme: dark) {
    .dia-modal {
        background: var(--dia-dark-bg);
        color: var(--dia-dark-text);
        border: 1px solid var(--dia-dark-border);
    }
    
    .dia-modal-header {
        border-bottom-color: var(--dia-dark-border);
    }
    
    .dia-modal-footer {
        border-top-color: var(--dia-dark-border);
    }
    
    .dia-modal-title {
        color: var(--dia-primary-light);
    }
    
    .dia-modal-body .bg-light {
        background: var(--dia-dark-card-bg) !important;
        color: var(--dia-dark-text);
    }
}

/* === SCROLLBAR PERSONALIZADO === */

.dia-modal::-webkit-scrollbar {
    width: 6px;
}

.dia-modal::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.dia-modal::-webkit-scrollbar-thumb {
    background: var(--dia-primary);
    border-radius: 3px;
}

.dia-modal::-webkit-scrollbar-thumb:hover {
    background: var(--dia-primary-dark);
}
