/*generales*/
@font-face {
    font-family: 'Freesentation';
    src: url('../fonts/FreesentationVF.ttf') format('truetype');
}
:root{
    --primary-color: #212121;
    --text-color: #c9c9c9;
    --accent-color: #0071FF;
    --hover-color: #272832;
}

button {
  background: none;
  color: inherit;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: none;
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    font-family: 'Freesentation', sans-serif, Poppins;
    color: var(--text-color);    
}

body {
    background-color: #212121;
    min-height: 100vh;
    min-height: 100dvh;
}

main{
    padding: min(5em, 7%);
}

main p {
    padding: .35em;
}

a {
  text-decoration: none;
}

/*navbar*/

nav {
    background-color: var(--primary-color);
    border-bottom: 1px solid var(--hover-color);
}
nav ul {
    list-style: none;
    display: flex;
    align-items: center;
}

nav li {
    display: flex;
}

nav a{
    display: flex;
    text-decoration: none;
    color: var(--text-color);
    padding: 1em 2em;
}

nav .nav-text{
    color: var(--text-color);
    line-height: 2;
    position: relative;
}

nav .nav-text::before {
  content: '';
  width: 0;
  height: 2px;
  border-radius: 2px;
  background-color: #ffffff;
  position: absolute;
  bottom: 0.25rem;
  left: 50%;
  transition: width .4s, left .4s;
}

nav a{
    display: flex;
    text-decoration: none;
    color: var(--text-color);
    padding: 1em 2em;
}

nav .logo {
    padding: 0 1.5em;
}
nav .logo img {
    max-width: 100%;
    width: auto;
    height: 4em;
    aspect-ratio: 1/1;
    object-fit: cover;
}

nav #logo-campana img {
    height: 1.9rem;
}

nav #logo-usuario img {
    height: 2rem;
}

nav .nav-text:hover::before {
  width: 100%;
  left: 0;
}
nav a.active-link{
  color: var(--accent-color);
}
.container-movil {
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--hover-color);
    
}

#titulo-nav {
    display: none;
    color: var(--text-color);
    font-size: 1.5rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

#logo-inicio {
    margin-right: auto;
}

#espaciado-campana {
    margin-left: auto;
}

#abrir-menu {
    display: none;
    background: none;
    border: none;
    padding: 1em;
    cursor: pointer;
    margin-left: auto;
}

#cerrar-menu {
    display: none;
    background: none;
    border: none;
    padding: 1em;
    cursor: pointer;
}

#cerrar-menu img, #abrir-menu img {
    max-width: 100%;
    width: auto;
    height: 2em;
    aspect-ratio: 1/1;
    object-fit: cover;
}

#overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9;
    display: none;
}

/*grid*/

.box{
    border-radius: 1.4em;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.4);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    height: calc(100vh - 16em);
    grid-template-rows: repeat(2, minmax(400px, 45vh));
    gap: 1em;
    grid-template-areas: 
    "box1 box1 box1"
    "box2 box3 box4";
}

#main-box-container {
    display: flex;
    gap: 1em;
    padding: 1em;
}

.info-box {
    background: #0505053f;
    border-radius: 0.8em;
    padding: 1.5em;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#main-box-container > div {
    flex: 1 1 32%;
    min-width: 280px;
}

/*clima*/

form:has(div.user-box) {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
}
.login-box {
    height: 100%;
    background: #0505053f;
    box-sizing: border-box;
    border-radius: 0.8em;
}

.login-box .user-box {
  position: relative;
  width: 80%;
}

.login-box form button, #search-again-btn {
  padding: 0.5em 1em;
  color: #ffffff;
  font-size: 1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: .5s;
  letter-spacing: 0.2em;
  border: 1px solid var(--hover-color);
}

.login-box form button:hover {
  background: var(--hover-color);
}

.weather-results {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1em;
    gap: 0.5em;
}

.weather-results h1, .weather-results h2, .weather-results h3 {
    margin: 0;
}

.weather-results .weather-title {
    font-size: 1.5rem;
}

.weather-results .weather-description {
    text-transform: capitalize;
    color: #bdb8b8;
}

.weather-results .weather-temp {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-color);
}

.weather-results p {
    font-size: 1rem;
    margin: 0.2em 0;
}

#search-again-btn:hover {
  background: var(--hover-color);
}

#weather-container .ts-control {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid #fff !important;
    border-radius: 0 !important;
    padding: 0.5em 0 !important;
    box-shadow: none !important;
}

#weather-container .ts-control,
#weather-container .ts-control input {
    color: #fff !important;
    font-size: 1rem;
}

#weather-container .user-box label {
    position: absolute;
    top: 0;
    left: 0;
    padding: 0.8em 0;
    font-size: 1rem;
    color: #fff;
    pointer-events: none;
    transition: .5s;
}

#weather-container .user-box label.active {
    top: -1.5em;
    left: 0;
    color: #bdb8b8;
    font-size: 0.8rem;
}

.ts-dropdown {
    background: var(--primary-color) !important;
    border: 1px solid var(--hover-color) !important;
    color: var(--text-color);
}

.ts-dropdown .option.active, .ts-dropdown .option:hover {
    background-color: var(--hover-color) !important;
    color: #fff !important;
}

/* Grafico Riego */
.chart-container {
    padding: 1.5em 0 1.5em 0;
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5em 0 1.5em;
    flex-wrap: wrap;
    gap: 1em;
}

.chart-toggle button {
    padding: 0.5em 1em;
    color: var(--text-color);
    border: 1px solid var(--hover-color);
    margin-left: 0.5em;
    border-radius: 0.5em;
    transition: background-color 0.3s;
}

.chart-toggle button:hover {
    background-color: var(--hover-color);
}

.chart-toggle button.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
}

#chart  #fertilizer-chart {
    flex-grow: 1;
    min-height: 0;
    align-content: 0;
    padding-bottom: 1.5em;
}

/*responsive*/

@media screen and (max-width: 1535px) {
    .grid-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        height: calc(100vh - 16em);
        grid-template-rows: repeat(4, 1fr);
        gap: 1em;
        grid-template-areas: 
        "box1 box1 box1"
        "box2 box2 box2"
        "box3 box3 box3"
        "box4 box4 box4";
}
}

@media screen and (max-width: 1024px) {
    #main-box-container {
        flex-direction: column;
    }
}

@media screen and (max-width: 750px) {
    #abrir-menu, #cerrar-menu {
        display: block;
    }
    #logo-inicio {
        margin-right: 0;
    }
    #espaciado-campana {
        margin-left: 0;
    }
    #espaciado-cerrar {
        margin-right: auto;
    }
    #titulo-nav {
        display: inline-block;
    }
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: min(15em, 100%);
        z-index: 10;
        border-left: 1px solid var(--hover-color);
        transition: right 0.3s ease-in-out;
     }
    nav.show {
        right: 0;
     }
    
    nav.show ~ #overlay {
        display: block;
     }
    nav ul{
        width: 100%;
        flex-direction: column;
     }
    nav a {
        width: 100%;
        padding-left: -2.5em;
     }
     nav .logo {
        padding: 0 1.5em;
        margin: 1em;
     }
     .grid-container {
        display: grid;
        grid-template-columns: auto;
        grid-template-rows: auto;
        gap: 1em;
        height: auto;
        grid-template-areas: 
        "box1 "
        "box2 "
        "box3 "
        "box4 ";
    }
    .login-box {
        width: 100%;
        height: auto;
        padding: 2em 1em;
    }
    .weather-results .weather-title {
        font-size: 1.3rem;
    }
    .weather-results .weather-temp {
        font-size: 2.2rem;
    }
    #irrigation-chart-container #fertilizer-chart-container {
        min-height: 60vh;
        padding-bottom: 0;
    }
    #chart #fertilizer-chart {
        padding-bottom: 1.5em;
    }
}
@media screen and (max-width: 375px) {
    .login-box, .weather-results {
        width: 100%;
    }
    .weather-results .weather-title {
        font-size: 1.2rem;
    }
    .weather-results .weather-temp {
        font-size: 2rem;
    }
    .weather-results p {
        font-size: 0.9rem;
    }
}
