/**
 * Estilos para Detección de Dispositivos
 * Centro de Estudios Plugin
 * 
 * @package Centro_Estudios
 * @subpackage Inscripciones_Public
 * @version 2.7.0
 * @since 2.7.0
 */

/* Indicadores de dispositivo */
.ces-device-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 9999;
    display: none; /* Solo visible en desarrollo */
}

.ces-device-indicator.mobile {
    background: #4caf50;
}

.ces-device-indicator.tablet {
    background: #ff9800;
}

.ces-device-indicator.desktop {
    background: #2196f3;
}

/* Transiciones suaves entre vistas */
.ces-form-container {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ces-form-container.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.ces-form-container.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Adaptaciones específicas por dispositivo */
.ces-mobile-only {
    display: none;
}

.ces-tablet-only {
    display: none;
}

.ces-desktop-only {
    display: none;
}

/* Mobile First - Mostrar por defecto en móvil */
@media (max-width: 767px) {
    .ces-mobile-only {
        display: block;
    }
    
    .ces-tablet-only,
    .ces-desktop-only {
        display: none;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .ces-tablet-only {
        display: block;
    }
    
    .ces-mobile-only,
    .ces-desktop-only {
        display: none;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .ces-desktop-only {
        display: block;
    }
    
    .ces-mobile-only,
    .ces-tablet-only {
        display: none;
    }
}

/* Estilos para formulario adaptativo */
.ces-form-adaptive {
    transition: all 0.3s ease;
}

.ces-form-adaptive.mobile-layout {
    padding: 16px;
}

.ces-form-adaptive.tablet-layout {
    padding: 24px;
    max-width: 600px;
    margin: 0 auto;
}

.ces-form-adaptive.desktop-layout {
    padding: 32px;
    max-width: 800px;
    margin: 0 auto;
}

/* Botones adaptativos */
.ces-btn-adaptive {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

@media (min-width: 768px) {
    .ces-btn-adaptive {
        width: auto;
        min-width: 120px;
        padding: 12px 24px;
    }
}

/* Campos de formulario adaptativos */
.ces-field-adaptive {
    width: 100%;
    min-height: 44px;
    font-size: 16px; /* Previene zoom en iOS */
    border-radius: 6px;
    transition: all 0.2s ease;
}

@media (min-width: 768px) {
    .ces-field-adaptive {
        min-height: 40px;
        font-size: 14px;
    }
}

/* Grid adaptativo */
.ces-grid-adaptive {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .ces-grid-adaptive {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .ces-grid-adaptive {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

/* Espaciado adaptativo */
.ces-spacing-adaptive {
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .ces-spacing-adaptive {
        margin-bottom: 20px;
    }
}

@media (min-width: 1024px) {
    .ces-spacing-adaptive {
        margin-bottom: 24px;
    }
}

/* Tipografía adaptativa */
.ces-text-adaptive {
    font-size: 14px;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .ces-text-adaptive {
        font-size: 16px;
        line-height: 1.5;
    }
}

.ces-title-adaptive {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .ces-title-adaptive {
        font-size: 24px;
        margin-bottom: 20px;
    }
}

@media (min-width: 1024px) {
    .ces-title-adaptive {
        font-size: 28px;
        margin-bottom: 24px;
    }
}

/* Estados de carga adaptativos */
.ces-loading-adaptive {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
}

.ces-loading-adaptive .ces-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: ces-spin 1s linear infinite;
}

@media (min-width: 768px) {
    .ces-loading-adaptive {
        padding: 24px;
        gap: 16px;
    }
    
    .ces-loading-adaptive .ces-spinner {
        width: 32px;
        height: 32px;
        border-width: 4px;
    }
}

/* Mensajes adaptativos */
.ces-message-adaptive {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .ces-message-adaptive {
        padding: 16px 20px;
        font-size: 16px;
        margin-bottom: 20px;
    }
}

.ces-message-adaptive.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ces-message-adaptive.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ces-message-adaptive.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.ces-message-adaptive.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}
