/* ========== VARIABLES GLOBALES ========== */
:root {
    --primary-color: #003b50;      /* Azul oscuro principal */
    --secondary-color: #667eea;    /* Morado claro para acentos */
    --accent-color: #764ba2;       /* Morado oscuro para gradientes */
}

/* ========== RESET Y CONFIGURACIÓN BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: white;
    padding-top: 80px;
}

/* ========== NAVBAR PRINCIPAL ========== */
.navbar-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, #005a7a 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.3s ease;
}
.input-group-custom {
        flex-direction: column;
    }

    .input-group-custom select.unit-select {
        width: 100%;
    }

.navbar-brand:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-color);
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    margin: 0 10px;
    padding: 8px 16px !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
}

.nav-link:hover::after {
    width: 80%;
}

.dropdown-menu {
    background: white;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 10px;
}

.dropdown-item {
    border-radius: 8px;
    padding: 10px 16px;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    transform: translateX(5px);
}

/* ========== CONTENEDOR PRINCIPAL ========== */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#formCalculo {
    width: 100%;
    max-width: 800px;
}

/* ========== ENCABEZADO ========== */
.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 800px;
}

.page-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.btn-back {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    color: white;
}

/* ========== SECCIÓN GUARDAR PROYECTO ========== */
.save-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--secondary-color);
    width: 100%;
    max-width: 800px;
}

.save-section label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.save-section select {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.save-section select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#guardarContenedor {
    margin-top: 1rem;
}

#guardarContenedor input[type="text"],
#guardarContenedor textarea {
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

#guardarContenedor button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#guardarContenedor button:hover {
    background: var(--accent-color);
}

#listaProyectos {
    list-style: none;
    padding: 5px;
}

#listaProyectos li:hover {
    background: #f0f0f0;
}

/* ========== SECCIONES DEL FORMULARIO ========== */
.calc-section {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: white;
}

.calc-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.form-field {
    margin-bottom: 1rem;
}

.calc-section input,
.calc-section select {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.calc-section input:focus,
.calc-section select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.calc-section label {
    display: block;
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

/* ========== BOTONES DE ACCIÓN ========== */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}
    #btnPDF{
        background: red;
        color: white;
    }

.btn-calculate {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-reset {
    background: white;
    color: #6c757d;
    border: 2px solid #dee2e6;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

/* ========== RESULTADOS ========== */
.resultado {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
    border-left: 4px solid var(--secondary-color);
    width: 100%;
    max-width: 800px;
}

.resultado h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

#pasos {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

#resumen table {
    width: 100%;
    margin-top: 1rem;
}

#resumen table td {
    padding: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

/* ========== FOOTER ========== */
footer {
    text-align: center;
    padding: 2rem 0;
    color: #6c757d;
    font-size: 0.9rem;
    border-top: 1px solid #dee2e6;
    margin-top: 3rem;
    width: 100%;
    max-width: 800px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-calculate,
    .btn-reset {
        width: 100%;
    }
}

@media (max-width: 576px) {
    body {
        padding: 0 10px;
    }

    .navbar-brand span {
        font-size: 1rem;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .btn-back {
        font-size: 0.9rem;
        padding: 6px 10px;
    }

    .form-field label {
        font-size: 0.95rem;
    }

    .btn-calculate, .btn-reset {
        width: 100%;
        margin-bottom: 0.6rem;
    }

    table {
        font-size: 0.9rem;
    }

    footer small {
        font-size: 0.8rem;
    }
}
