/**
 * DIA Mobile Chat Styles
 * Estilos específicos para la versión móvil del chat
 */

/* === BREAKPOINTS PARA FORMULARIOS === */

/* Por defecto, mostrar versión móvil */
.desktop-only {
    display: none !important;
}

.mobile-only {
    display: block !important;
}

/* En pantallas medianas y grandes (768px+), mostrar versión desktop */
@media (min-width: 768px) {
    .desktop-only {
        display: block !important;
    }
    
    .mobile-only {
        display: none !important;
    }
}

/* === ESTILOS PARA VERSIÓN MÓVIL === */

.dia-input-form.mobile-only .dia-input-field {
    font-size: 16px; /* Evitar zoom en iOS */
    padding: 12px 16px;
    border-radius: 12px;
    min-height: 60px;
    resize: none;
    border: 2px solid var(--dia-primary);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* === ESTILOS PARA BOTÓN DE UBICACIÓN === */

/* Botón de ubicación activa (ubicación real del usuario) */
.dia-btn.dia-btn-success {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    border-color: #28a745 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    animation: pulse-success 2s infinite;
}

.dia-btn.dia-btn-success:hover {
    background: linear-gradient(135deg, #218838, #1e7e34) !important;
    border-color: #1e7e34 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.dia-btn.dia-btn-success i {
    color: white !important;
}

/* Botón de ubicación por defecto (Santander) - estilo diferente */
.dia-btn.dia-btn-success[title*="por defecto"] {
    background: linear-gradient(135deg, #6c757d, #495057) !important;
    border-color: #6c757d !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
    animation: pulse-default 3s infinite;
}

.dia-btn.dia-btn-success[title*="por defecto"]:hover {
    background: linear-gradient(135deg, #5a6268, #343a40) !important;
    border-color: #5a6268 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(108, 117, 125, 0.4);
}

/* Animación de pulso para botón activo */
@keyframes pulse-success {
    0% {
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    }
    50% {
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.5);
    }
    100% {
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    }
}

/* Animación de pulso para botón por defecto */
@keyframes pulse-default {
    0% {
        box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
    }
    50% {
        box-shadow: 0 4px 12px rgba(108, 117, 125, 0.5);
    }
    100% {
        box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
    }
}

.dia-input-form.mobile-only .dia-input-field:focus {
    border-color: var(--dia-primary-dark);
    box-shadow: 0 0 0 3px rgba(var(--dia-primary-rgb), 0.1);
    outline: none;
}

.dia-input-form.mobile-only .mobile-actions {
    padding: 8px 0;
}

/* Botones móviles */
.dia-btn-mobile {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--dia-primary);
    background: transparent;
    color: var(--dia-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.dia-btn-mobile::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--dia-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    z-index: -1;
}

.dia-btn-mobile:hover::before {
    width: 100%;
    height: 100%;
}

.dia-btn-mobile:hover {
    color: white;
    transform: scale(1.05);
}

.dia-btn-mobile.dia-btn-primary {
    background: var(--dia-primary);
    color: white;
    border-color: var(--dia-primary);
}

.dia-btn-mobile.dia-btn-primary::before {
    background: var(--dia-primary-dark);
}

.dia-btn-mobile.dia-btn-primary:hover {
    background: var(--dia-primary-dark);
    border-color: var(--dia-primary-dark);
}

/* Estados activos para micrófono */
.dia-btn-mobile.recording {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
    animation: pulse 1s infinite;
}

.dia-btn-mobile.recording::before {
    background: #b02a37;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Spinner para botones móviles */
.dia-btn-mobile .dia-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive para pantallas muy pequeñas */
@media (max-width: 480px) {
    .dia-input-form.mobile-only .dia-input-field {
        font-size: 16px;
        padding: 10px 12px;
        min-height: 50px;
        border-radius: 10px;
    }
    
    .dia-btn-mobile {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .dia-input-form.mobile-only .mobile-actions {
        padding: 6px 0;
    }
    
    .dia-btn-mobile .dia-spinner {
        width: 14px;
        height: 14px;
    }
}

/* Mejoras para pantallas táctiles */
@media (hover: none) and (pointer: coarse) {
    .dia-btn-mobile {
        min-width: 44px;
        min-height: 44px;
    }
    
    .dia-btn-mobile:active {
        transform: scale(0.95);
    }
    
    .dia-btn-mobile:hover {
        transform: none; /* Desactivar hover en dispositivos táctiles */
    }
}

/* Contador de caracteres móvil */
.dia-input-form.mobile-only .text-muted {
    font-size: 12px;
    font-weight: 500;
}

/* Animaciones suaves para transiciones entre breakpoints */
.dia-input-form {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Estados de carga para inputs móviles */
.dia-input-form.mobile-only .dia-input-field:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mejoras de accesibilidad */
.dia-btn-mobile:focus {
    outline: 2px solid var(--dia-primary);
    outline-offset: 2px;
}

.dia-btn-mobile:focus:not(:focus-visible) {
    outline: none;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .dia-input-form.mobile-only .dia-input-field {
        background: rgba(30, 30, 30, 0.95);
        color: white;
        border-color: var(--dia-primary-light);
    }
    
    .dia-btn-mobile {
        border-color: var(--dia-primary-light);
        color: var(--dia-primary-light);
    }
    
    .dia-btn-mobile.dia-btn-primary {
        background: var(--dia-primary-light);
        color: #000;
    }
}
