/* Reset y configuración básica */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* ============================================
   PÁGINA DE ENTRADA (index.html)
   ============================================ */

.hero-landing {
    position: relative;
    width: 100%;
    height: 100vh;
    background-image: url('../img/fondo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 2rem;
    max-width: 800px;
}

.main-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    line-height: 1.2;
}

.subtitle {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
    font-weight: 300;
}

.btn-comenzar {
    display: inline-block;
    padding: 1.2rem 3rem;
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    color: white;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(255, 140, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-comenzar:hover {
    background: linear-gradient(135deg, #ffa500, #ff8c00);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255, 140, 0, 0.6);
}

.btn-comenzar:active {
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .btn-comenzar {
        font-size: 1.1rem;
        padding: 1rem 2rem;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .btn-comenzar {
        font-size: 1rem;
        padding: 0.9rem 1.8rem;
    }
}

/* ============================================
   PÁGINA DE APARATOS (lista_de_aparatos.html)
   ============================================ */

.page-aparatos {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    min-height: 100vh;
}

/* Header con imagen de fondo */
.header-aparatos {
    position: relative;
    width: 100%;
    height: 35vh;
    background-image: url('../img/calculo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay-aparatos {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 2rem;
}

.header-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.header-content p {
    font-size: 1.2rem;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

/* Contenedor principal */
.main-container {
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.tabla-container {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.tabla-container h2 {
    color: #2196F3;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.instrucciones {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Tabla */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: 2rem;
}

#tabla-aparatos {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

#tabla-aparatos thead {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

#tabla-aparatos th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

#tabla-aparatos tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s ease;
}

#tabla-aparatos tbody tr:hover {
    background: #f5f5f5;
}

#tabla-aparatos td {
    padding: 0.8rem;
    vertical-align: middle;
}

/* Inputs dentro de la tabla */
#tabla-aparatos input[type="text"],
#tabla-aparatos input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

#tabla-aparatos input:focus {
    outline: none;
    border-color: #2196F3;
}

/* Celdas calculadas (solo lectura) */
.potencia-total,
.energia-diaria {
    font-weight: 600;
    color: #1976D2;
    text-align: center;
}

/* Botón eliminar */
.btn-eliminar {
    background: #f44336;
    color: white;
    border: none;
    padding: 0.4rem 0.7rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s ease;
}

.btn-eliminar:hover {
    background: #d32f2f;
}

/* Fila total */
.fila-total {
    background: #e3f2fd;
    font-size: 1.1rem;
}

.fila-total td {
    padding: 1rem;
}

.text-right {
    text-align: right;
}

.total-energia {
    color: #FF6B35;
    font-size: 1.3rem;
}

/* Botones de acción */
.botones-accion {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-agregar,
.btn-calcular {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-agregar {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-agregar:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

.btn-calcular {
    background: linear-gradient(135deg, #FF6B35, #ff8c00);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.btn-calcular:hover {
    background: linear-gradient(135deg, #ff8c00, #FF6B35);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 2rem;
    }

    .header-content p {
        font-size: 1rem;
    }

    .tabla-container {
        padding: 1.5rem;
    }

    .tabla-container h2 {
        font-size: 1.5rem;
    }

    #tabla-aparatos th,
    #tabla-aparatos td {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .btn-agregar,
    .btn-calcular {
        width: 100%;
        padding: 0.9rem 1.5rem;
    }
}

/* ============================================
   PÁGINA DE RESULTADOS (resultados.html)
   ============================================ */

.page-resultados {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    min-height: 100vh;
}

/* Header con imagen de fondo */
.header-resultados {
    position: relative;
    width: 100%;
    height: 30vh;
    background-image: url('../img/paneles.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay-resultados {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* Resumen de consumo */
.resumen-consumo {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* Guía Informativa */
.guia-informativa {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.guia-informativa h2 {
    color: #9C27B0;
    margin-bottom: 1.5rem;
    text-align: center;
}

.info-expandible {
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 0.8rem;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.info-expandible summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    background: linear-gradient(135deg, #f5f5f5, #eeeeee);
    transition: background 0.3s ease;
    list-style: none;
    display: flex;
    align-items: center;
}

.info-expandible summary::-webkit-details-marker {
    display: none;
}

.info-expandible summary::before {
    content: '+';
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 22px;
    text-align: center;
    background: #9C27B0;
    color: white;
    border-radius: 50%;
    margin-right: 1rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.info-expandible[open] summary::before {
    content: '-';
    transform: rotate(180deg);
}

.info-expandible summary:hover {
    background: linear-gradient(135deg, #eeeeee, #e0e0e0);
}

.info-contenido {
    padding: 1.5rem;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.info-contenido p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.info-contenido ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.info-contenido ul li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.info-contenido ul li strong {
    color: #9C27B0;
}

.tabla-voltaje {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.tabla-voltaje th,
.tabla-voltaje td {
    border: 1px solid #e0e0e0;
    padding: 0.8rem 1rem;
    text-align: left;
}

.tabla-voltaje th {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    color: white;
}

.tabla-voltaje tr:nth-child(even) {
    background: #f5f5f5;
}

/* Datos del Panel Solar */
.datos-panel {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.datos-panel h2 {
    color: #FF9800;
    margin-bottom: 0.5rem;
    text-align: center;
}

.datos-panel .instrucciones {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
}

/* Especificaciones de Batería */
.datos-bateria {
    background: #f3e5f5;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 2rem;
    border-left: 4px solid #9C27B0;
}

.datos-bateria h3 {
    color: #7B1FA2;
    margin-bottom: 0.5rem;
}

.datos-bateria .instrucciones {
    text-align: left;
    margin-bottom: 1rem;
}

/* Cálculos Intermedios */
.calculos-intermedios {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 15px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 2px dashed #4CAF50;
}

.calculos-intermedios h2 {
    color: #2E7D32;
    margin-bottom: 0.5rem;
    text-align: center;
}

.nota-verificacion {
    text-align: center;
    color: #558B2F;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.calc-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calc-label {
    font-weight: 600;
    color: #333;
}

.calc-valor {
    color: #2E7D32;
    font-weight: 700;
    font-size: 1.1rem;
}

.resumen-consumo h2 {
    color: #FF6B35;
    margin-bottom: 1rem;
}

.consumo-info {
    font-size: 1.2rem;
}

.consumo-info span {
    color: #FF6B35;
    font-weight: 700;
}

/* Parámetros del sistema */
.parametros-sistema {
    background: white;
    border-radius: 15px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.parametros-sistema h2 {
    color: #2196F3;
    margin-bottom: 1.5rem;
    text-align: center;
}

.param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.param-item label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.param-item input,
.param-item select {
    width: 100%;
    padding: 0.7rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.param-item input:focus,
.param-item select:focus {
    outline: none;
    border-color: #2196F3;
}

.param-item small {
    display: block;
    color: #666;
    margin-top: 0.3rem;
    font-size: 0.85rem;
}

/* Proveedores */
.proveedores-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #e3f2fd;
    border-radius: 10px;
    border-left: 4px solid #2196F3;
}

.proveedores-section h3 {
    color: #1976D2;
    margin-bottom: 0.5rem;
}

.proveedores-nota {
    color: #666;
    margin-bottom: 1rem;
}

.proveedores-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.placeholder-links {
    color: #999;
    font-style: italic;
}

.btn-calcular-sistema {
    width: 100%;
    padding: 1.2rem 2rem;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-calcular-sistema:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.5);
}

/* Resultados Grid */
.resultados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.resultado-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.resultado-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #FF6B35, #ff8c00);
    color: white;
    padding: 1.2rem;
    text-align: center;
}

.card-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.card-body {
    padding: 1.5rem;
}

.card-body p {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.card-body strong {
    color: #333;
}

.valor-destacado {
    color: #FF6B35;
    font-size: 1.3rem;
    font-weight: 700;
}

.recomendacion {
    background: #e8f5e9;
    padding: 0.8rem;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
    margin-top: 1rem;
}

.nota-breaker {
    background: #fff3e0;
    padding: 0.8rem;
    border-radius: 8px;
    border-left: 4px solid #FF9800;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.cable-spec {
    margin-left: 1rem;
    margin-bottom: 1rem;
    color: #666;
}

/* Acciones finales */
.acciones-finales {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn-nuevo-calculo,
.btn-imprimir {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-nuevo-calculo {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

.btn-nuevo-calculo:hover {
    background: linear-gradient(135deg, #1976D2, #2196F3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.5);
}

.btn-imprimir {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    color: white;
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.4);
}

.btn-imprimir:hover {
    background: linear-gradient(135deg, #7B1FA2, #9C27B0);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(156, 39, 176, 0.5);
}

/* Responsive para resultados */
@media (max-width: 768px) {
    .header-resultados {
        height: 25vh;
    }

    .parametros-sistema {
        padding: 1.5rem;
    }

    .param-grid {
        grid-template-columns: 1fr;
    }

    .resultados-grid {
        grid-template-columns: 1fr;
    }

    .acciones-finales {
        flex-direction: column;
    }

    .btn-nuevo-calculo,
    .btn-imprimir {
        width: 100%;
    }
}

/* Tabla comparación baterías */
.tabla-comparacion-baterias {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.tabla-comparacion-baterias th,
.tabla-comparacion-baterias td {
    padding: 8px 12px;
    text-align: center;
    border: 1px solid #ddd;
}

.tabla-comparacion-baterias th {
    background: #2e7d32;
    color: white;
}

.tabla-comparacion-baterias tr:nth-child(even) {
    background: #f5f5f5;
}

.tabla-comparacion-baterias .fila-seleccionada {
    background: #c8e6c9;
    font-weight: bold;
}

.tabla-comparacion-card {
    grid-column: span 2;
}

/* Especificaciones para buscar en tienda */
.especificaciones-buscar {
    margin-top: 15px;
    padding: 12px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left: 4px solid #4caf50;
    border-radius: 0 8px 8px 0;
}

.especificaciones-buscar p {
    margin-bottom: 8px;
    color: #2e7d32;
    font-size: 0.95rem;
}

.especificaciones-buscar ul {
    list-style: none;
    padding-left: 0;
}

.especificaciones-buscar li {
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
    font-size: 0.9rem;
    color: #1b5e20;
}

.especificaciones-buscar li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4caf50;
    font-weight: bold;
}

.especificaciones-buscar span {
    font-weight: bold;
    color: #1b5e20;
    background: rgba(255,255,255,0.5);
    padding: 1px 6px;
    border-radius: 4px;
}

/* Estilos para impresión */
@media print {
    .header-resultados,
    .btn-calcular-sistema,
    .acciones-finales {
        display: none;
    }

    .page-resultados {
        background: white;
    }

    .resultado-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .especificaciones-buscar {
        background: #f5f5f5;
        border-left: 3px solid #333;
    }
}
