/* Base Styles - Sistema híbrido de plantillas */
/* Variables CSS globales */
:root {
    --primary-color: #d63031;
    --secondary-color: #e17055;
    --background-gradient: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    --header-bg: rgba(255, 255, 255, 0.95);
    --shadow-base: 0 2px 20px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --border-radius-large: 20px;
    --transition-base: all 0.3s ease;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Reset y estilos base globales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--background-gradient);
    min-height: 100vh;
    color: #333;
}

/* === HEADER UNIFICADO === */
/* Estilos comunes para todos los headers */
.dashboard-header,
.inspecciones-header,
.app-header {
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-base);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.brand-text h1 {
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.brand-subtitle,
.subtitle {
    color: #666;
    font-size: 0.9rem;
    margin: 0.2rem 0;
    font-style: italic;
}

.titulo-inspeccion {
    font-size: 1.4rem !important;
    line-height: 1.3;
    color: #d63031 !important;
}

.planta-empresa {
    font-style: normal;
    font-weight: 500;
}

.fecha-inicio {
    color: #888;
    font-size: 0.8rem;
    font-style: italic;
}

.version {
    color: #999;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(214, 48, 49, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-card {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.user-welcome {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

.user-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.user-company {
    font-size: 0.85rem;
    color: #666;
}

.back-btn, .logout-btn {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease;
    font-size: 0.9rem;
}

.back-btn:hover, .logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(225, 112, 85, 0.3);
}

/* Botón volver en header de inspección/prueba - color naranja rojizo */
.inspeccion-header-custom .back-btn {
    background: linear-gradient(135deg, #e17055 0%, #d63031 100%) !important;
}

.inspeccion-header-custom .back-btn:hover {
    background: linear-gradient(135deg, #d63031 0%, #c0392b 100%) !important;
}

/* === TÍTULO MÓVIL === */
.mobile-app-title {
    display: none;
}

/* === MAIN CONTENT === */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
    .header-content {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .brand-container {
        justify-content: center;
    }

    .brand-text h1 {
        font-size: 1.2rem;
    }

    .brand-subtitle,
    .subtitle {
        font-size: 0.8rem;
    }

    /* EXCEPCIÓN: Para páginas de inspección mantener layout horizontal */
    .inspeccion-header-custom .header-content {
        flex-direction: row !important;
        text-align: left !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 1rem !important;
    }

    .inspeccion-header-custom .brand-container {
        justify-content: flex-start !important;
        flex: 1;
    }

    .inspeccion-header-custom .brand-text {
        text-align: left !important;
    }

    /* FORZAR VISIBILIDAD de información de inspección */
    .inspeccion-header-custom #header-inspeccion-titulo,
    .inspeccion-header-custom #header-inspeccion-planta,
    .inspeccion-header-custom #header-inspeccion-empresa,
    .inspeccion-header-custom #header-inspeccion-fecha,
    .inspeccion-header-custom .titulo-inspeccion,
    .inspeccion-header-custom .planta-empresa,
    .inspeccion-header-custom .fecha-inicio {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #333 !important;
    }

    /* Tamaños específicos para header de inspección en tabletas/móviles */
    .inspeccion-header-custom .titulo-inspeccion {
        font-size: 1.1rem !important;
        line-height: 1.2;
        margin: 0;
    }

    .inspeccion-header-custom .planta-empresa {
        font-size: 0.85rem !important;
        margin: 2px 0;
    }

    .inspeccion-header-custom .fecha-inicio {
        font-size: 0.75rem !important;
        margin: 2px 0;
    }

    .inspeccion-header-custom .header-right {
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
    }

    .header-right {
        flex-direction: column;
        gap: 1rem;
    }

    .user-card {
        text-align: center;
    }

    .main-content {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .dashboard-header,
    .inspecciones-header,
    .app-header {
        position: relative;
    }

    .header-content {
        padding: 0.4rem 0.75rem;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
    }

    /* Solo información del usuario en el header */
    .header-right {
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
    }

    .user-card {
        gap: 0.1rem;
        text-align: right;
    }

    .user-welcome {
        font-size: 0.7rem;
    }

    .user-name {
        font-size: 0.8rem;
    }

    .user-company {
        font-size: 0.7rem;
    }

    .logout-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Ocultar completamente la marca del header en móviles */
    .brand-logo {
        display: none;
    }

    .brand-container {
        display: none;
    }

    /* Ocultar botón volver en móviles (inspecciones específicamente) */
    .back-btn {
        display: none;
    }

    /* Mostrar título móvil grande y vistoso */
    .mobile-app-title {
        display: block;
        margin-bottom: 2rem;
        padding: 1.5rem 1rem;
        background: linear-gradient(135deg, rgba(214, 48, 49, 0.1) 0%, rgba(225, 112, 85, 0.05) 100%);
        border-radius: 15px;
    }

    .mobile-title-container {
        display: flex;
        align-items: center;
        gap: 1rem;
        justify-content: center;
    }

    .mobile-logo {
        width: 60px;
        height: 60px;
        object-fit: contain;
        border-radius: var(--border-radius);
        flex-shrink: 0;
    }

    .mobile-title-text {
        text-align: left;
    }

    .mobile-app-title h1 {
        color: var(--primary-color);
        font-size: 1.8rem;
        font-weight: 700;
        margin: 0 0 0.5rem 0;
        line-height: 1.2;
    }

    .mobile-app-title p {
        color: #666;
        font-size: 1.3rem;
        margin: 0;
        font-style: italic;
    }
}

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
    .header-content {
        padding: 0.3rem 0.5rem;
    }

    /* Solo usuario, más compacto */
    .user-welcome {
        font-size: 0.65rem;
    }

    .user-name {
        font-size: 0.75rem;
    }

    .user-company {
        font-size: 0.65rem;
    }

    .logout-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }

    .main-content {
        padding: 0.75rem;
    }

    /* Título móvil más compacto en pantallas muy pequeñas */
    .mobile-app-title {
        margin-bottom: 1.5rem;
        padding: 1rem 0.75rem;
    }

    .mobile-title-container {
        gap: 0.75rem;
    }

    .mobile-logo {
        width: 50px;
        height: 50px;
    }

    .mobile-app-title h1 {
        font-size: 1.5rem;
    }

    .mobile-app-title p {
        font-size: 1.1rem;
    }
}

/* === UTILIDADES COMUNES === */
.btn-primary, .btn-secondary {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(225, 112, 85, 0.3);
}

.btn-secondary {
    background: rgba(225, 112, 85, 0.1);
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

/* === ANIMACIONES === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Clases de utilidad para animaciones */
.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.fade-in-up:nth-child(1) { animation-delay: 0.1s; }
.fade-in-up:nth-child(2) { animation-delay: 0.2s; }
.fade-in-up:nth-child(3) { animation-delay: 0.3s; }
.fade-in-up:nth-child(4) { animation-delay: 0.4s; }
.fade-in-up:nth-child(5) { animation-delay: 0.5s; }
.fade-in-up:nth-child(6) { animation-delay: 0.6s; }

/* === COMPONENTES REUTILIZABLES === */

/* Tarjetas de contenido */
.content-card, .equipo-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.content-card:hover, .equipo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

/* Header de tarjetas */
.content-header, .equipo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.content-info, .equipo-info {
    flex: 1;
}

.content-info h3, .equipo-info h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.content-info p, .equipo-info p {
    margin: 0.25rem 0;
    color: #666;
    font-size: 0.9rem;
}

.content-actions, .equipo-actions {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
}

/* Formularios comunes */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.1);
}

/* Grid de formularios */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Botones adicionales */
.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
    transform: translateY(-2px);
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-2px);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* === ESTILOS ESPECÍFICOS PARA REPORTES SELECCIONABLES === */
.reporte-seleccionable:hover {
    transform: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    cursor: default;
}