@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root {
    --color-main: #182f2f; /* Definir los colores de la pagina */
    --color-main-dark: #101d1f;
    --color-menu-text: #f7f7d3;
    --color-info-text: #334155;
    --color-border: #25736a;
}

* {
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    text-decoration: none;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

body {
    overflow-x: hidden;
}

#sidebar-toggle {
    display: none;
}

.body-label {
    position: fixed;
    height: 100%;
    width: calc(100% - 280px);
    z-index: 30;
    right: -100%;
    top: 0;
}

#sidebar-toggle:checked ~ .sidebar {
    left: -100%;
}

#sidebar-toggle:checked ~ .main-content header {
    left: 0;
    right: 0;
    width: 100%
}

#sidebar-toggle:checked ~ .main-content{
    margin-left: 0;
}

.sidebar {
    width: 280px;
    height: 100%;
    position: fixed;
    left: 0;
    top: 0;
    padding: 1rem 1.5rem;
    background: linear-gradient(180deg, var(--color-main) 0%, var(--color-main-dark) 100%);
    color: #fff; /* Color del texto en la barra */
    z-index: 20;
    transition: left 300ms;
}

.sidebar-brand {
    height: 80px;
}

.brand-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-user {
    margin: 0rem 0rem 1rem 0rem;
    text-align: center;
}

.sidebar-user img {
    width: 40%;
    
}

.sidebar-user h3 {
    font-size: 1rem;
}

.sidebar-user span {
    font-size: 0.85rem;
}

.sidebar-menu {
    margin-top: 6rem;
}

.menu-head {
    text-transform: uppercase;
    color: var(--color-menu-text);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.sidebar-menu ul {
    margin-bottom: 1.3rem;
}

.sidebar-menu li{
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.sidebar-menu li a{
    color: #efefef;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.sidebar-menu li a span {
    font-size: 1.5rem;
    display: inline-block;
    margin: 0.8rem;
}

.main-content {
    margin-left: 280px;
}

header {
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    position: fixed;
    left: 280px;
    width: calc(100% - 280px);
    top: 0;
    z-index: 20;
    background: #fcfceb;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.1);
    transition: left 300ms;
}
/* icono de la barra de menú */
.menu-toggle label {
    height: 50px;
    width: 50px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    border-radius: 50%;

}

.menu-toggle label:hover {
    background: #ededda;
    cursor: pointer;
}

.main-content {
    margin-left: 280px;
    transition: margin-left 300ms;
}

main {
    padding: 1.5rem;
    background: #f5fcfc;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

.page-header {
    display: flex;
    justify-content: center;

}

@media only screen and (max-width: 1124px) {
    .sidebar {
        left: -100%;
        z-index: 30;
    }

    .main-content {
        margin-left: 0;
    }

    header {
        left: 0;
        width: 100%;
    }

    #sidebar-toggle:checked ~ .sidebar {
        left: 0;
    }

    #sidebar-toggle:checked ~ .body-label {
        right: 0;
    }
}

@media only screen and (max-width: 768px) {
    .cards {
        grid-template-columns: 100%;
    }
    .page-header {
        display: block;
    }
    .header-actions {
        margin-top: 1rem;
        text-align: right;
    }
}

/* === FONDO CON VIDEO PARA HOME === */
.video-background {
    position: fixed;
    top: 60px;
    left: 280px;
    width: calc(100% - 280px);
    height: calc(100vh - 60px);
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

/* Overlay oscuro sobre el video */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

main {
    position: relative;
    z-index: 2; /* Por encima del video */
}

/* === HOME === */
.home-container {
    background: transparent;
    margin-top: 2rem;
    padding: 5rem 4rem;
    border-radius: 12px;
    animation: fadeInUp 0.6s ease-in-out;
    text-align: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.home-intro p {
    color: #ffffff;
    font-size: 1.4rem;
    line-height: 2;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 400;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}
.home-intro p:first-of-type {
    margin-top: 1.5rem;
    font-size: 1.6rem;
    font-weight: 500;
}

.page-header {
    display: flex;
    justify-content: space-between;

}
.page-header h1 {
    font-size: 2rem;
    color: var(--color-main);
    font-weight: 600;
}
.page-header small {
    display: block;
    color: var(--color-info-text);
    font-size: 1rem;
    margin-top: 0.3rem;
    font-weight: 500;
}

.page-headerHome {
    position: relative;
    background: transparent;
    padding: 10rem 2rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 90px);
}
.page-headerHome h1 {
    font-size: 3.5rem;
    color: #ffffff;
    font-weight: 700;
    text-shadow: 3px 3px 12px rgba(0, 0, 0, 0.9);
    margin: 0;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}
.page-headerHome small {
    display: block;
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 400;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}
.page-headerHome div {
    width: 100%;
}

html {
    scroll-behavior: smooth;
}

/* === BOTÓN SCROLL DOWN === */
.scroll-down-btn {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
    animation: bounce 3s infinite;
    text-decoration: none; /*enlace <a>*/
    border: none; /*boton*/
}

.scroll-down-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.scroll-down-btn svg {
    width: 24px;
    height: 24px;
    fill: var(--color-main);
    transition: transform 0.3s ease;
}

.scroll-down-btn:hover svg {
    transform: translateY(3px);
}

/* Animación de rebote */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Responsive video */
@media only screen and (max-width: 1900px) {
    .video-background {
        left: 0;
        width: 100%;
    }
}

/* Responsive mobile */
@media only screen and (max-width: 768px) {
    .home-container {
        padding: 7rem 1.5rem;
    }

    .home-intro p {
        font-size: 1.1rem;
        line-height: 1.8;
        margin-bottom: 1.5rem;
    }

    .home-intro p:first-of-type {
        font-size: 1.3rem;
        padding: 2rem;
        margin-bottom: 3rem;
    }

    .page-headerHome h1 {
        font-size: 2.5rem;
    }

    .page-headerHome small {
        font-size: 1rem;
    }

    .scroll-down-btn {
        width: 45px;
        height: 45px;
        bottom: 2rem;
    }

    .scroll-down-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Animación de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cajas de información reutilizables */
.card {
    background: #fff;
    padding: 2rem;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    margin-top: 2rem;
}

.info-box {
    margin-top: 1rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-left: 4px solid var(--color-border);
    border-radius: 5px;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-box h3 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    font-size: 1rem;
}

.info-box p {
    color: var(--color-info-text);
    font-size: 0.9rem;
    line-height: 1.6;
}

.info-box:hover {
    transform: translateY(-3px);
    box-shadow: 6px 6px 12px rgba(0,0,0,0.1);
}

#chart-container {
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 4px 4px 10px rgba(0,0,0,0.05);
}

/* === TEMPERATURAS === */
.temperaturas-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

.control-group select,
.control-group input[type="number"] {
    padding: 0.75rem 1rem;
    border: 2px solid #cbe1df;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    color: var(--color-info-text);
    transition: all 0.3s ease;
}

.control-group select:hover,
.control-group input[type="number"]:hover {
    border-color: var(--color-border);
}

.control-group select:focus,
.control-group input[type="number"]:focus {
    outline: none;
    border-color: var(--color-border);
    box-shadow: 0 0 0 3px rgba(88, 80, 236, 0.1);
}

.control-group input[type="number"]::-webkit-inner-spin-button,
.control-group input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
    height: 30px;
}

/* Resultado de interpolación */
.resultado-interpolacion {
    background: linear-gradient(135deg, #5d9392 0%, #44716f 100%);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    color: white;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
    margin-top: 1.2rem;
    animation: slideInUp 0.5s ease-out;
}

.resultado-interpolacion h2 {
    font-size: 3.5rem;
    margin: 0;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.resultado-interpolacion p {
    font-size: 1.2rem;
    margin-top: 0.5rem;
    opacity: 0.95;
    font-weight: 500;
}

.resultado-interpolacion small {
    display: block;
    margin-top: 1rem;
    opacity: 0.85;
    font-size: 1rem;
}

/* Animaciones */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Info box específica para temperaturas */
.info-box.green {
    background: #e0f7f3;
    border-left: 4px solid var(--color-border);
}

.info-box.green h3 {
    color: var(--color-border);
}

/* Chart container para temperaturas */
#chart-container-temp {
    background: #fafafa;
    padding: 1.5rem;
    border-radius: 10px;
    min-height: 500px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

/* Responsive para temperaturas */
@media only screen and (max-width: 768px) {
    .temperaturas-controls {
        grid-template-columns: 1fr;
    }
    
    .resultado-interpolacion h2 {
        font-size: 2.5rem;
    }
    
    .resultado-interpolacion p {
        font-size: 1rem;
    }
}

/* Tooltip helper para el input de mes */
.input-helper {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Estilo mejorado para el select */
.control-group select {
    cursor: pointer;
    appearance: none;
    padding-right: 2.5rem;
}

/* Estado disabled para controles */
.control-group select:disabled,
.control-group input:disabled {
    background-color: #f1f5f9;
    cursor: not-allowed;
    opacity: 0.6;
}