:root {
    --primary-color: #000000;
}

body {
    font-family: Poppins, sans-serif;
    margin: 0;
    background-color: #e9e7e7cc;
    position: relative;
    overflow-x: hidden;
    color: var(--primary-color);
}

.container {
    max-height: 100vh;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

.background-shape {
    position: fixed;
    width: 45%;
    height: 55%;
    background: #4092F8;
    border-radius: 0 0 100% 0;
    z-index: 0;
}

.top-left {
    top: 0;
    left: 0;
    transform: scale(1.2);
}

.bottom-right {
    bottom: 0;
    right: 0;
    transform: rotate(180deg) scale(1.2);
}

.current-time {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 12rem;
    background: rgba(255, 255, 255, 0.8);
    padding: 15px 30px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    z-index: 2;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#hour {
    font-size: 3em;
    font-weight: bold;
    color: var(--primary-color);;
}

h1 {
    font-size: 2.5em;
    text-align: center;
    color: var(--primary-color);;
    margin: 0 auto;
}

.main-station {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);;
    text-align: center;
    text-transform: uppercase;
}

.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
}

button {
    padding: 12px 24px;
    background-color: #4092F8;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #3272c6;
}

.train-cards {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 0 20px;
}

.train-cards .train-card:first-child {
    margin-right: 40px;
}

.train-cards.reverse {
    flex-direction: row-reverse;
}

.train-cards.reverse .train-card:first-child {
    margin-right: 0;
    margin-left: 40px;
}

.train-card {
    background: rgba(255, 255, 255, 0.39);
    border-radius: 24px;
    padding: 25px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    text-align: center;
    border: 3px solid #204BA7;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    width: 28em;
}

.destination-name {
    font-size: 4em;
    font-weight: bold;
    color: var(--primary-color);
    text-transform: uppercase;
}

.next-train-label {
    color: var(--primary-color);;
    font-size: 2.5em;
    margin: 5px 0;
}

.time-remaining-large {
    font-size: 7em;
    font-weight: bold;
    color: var(--primary-color);;
    line-height: 1;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
}

.time-remaining-large span {
    font-size: 0.3em;
    margin-top: 5px;
}

.upcoming-time span {
    font-size: 0.5em;
    color: #000000d0;
}

.next-trains-label {
    color: var(--primary-color);;
    font-size: 1.8em;
    padding-top: 15px;
}

.upcoming-trains {
    display: flex;
    justify-content: center;
    margin-top: 5px;
}

.upcoming-trains .upcoming-time:first-child {
    margin-right: 15px;
}

.upcoming-time {
    background: rgba(248, 249, 250, 0.6);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 3em;
    font-weight: bold;
    display: flex;
    align-items: baseline;
    gap: 2px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.error {
    color: #e74c3c;
    text-align: center;
    padding: 20px;
    background: #fdf0ef;
    border-radius: 8px;
    margin-top: 20px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--primary-color);;
}

.loader {
  position: relative;
  margin: 0 auto;
  width: fit-content;
  font-weight: bold;
  font-family: sans-serif;
  font-size: 4em;
  padding-bottom: 8px;
  background: linear-gradient(currentColor 0 0) 0 100%/0% 3px no-repeat;
  animation: l2 2s linear infinite;
}
.loader:before {
  content: "Buscando horarios...";
}
  @keyframes l2 {to{background-size: 100% 3px}}

@media screen and (max-width: 1200px) {
    .current-time {
        margin: 0 auto;
        position: relative;
        right: 0;
    }

    .train-cards .train-card:first-child {
        margin-right: 0;
        margin-bottom: 40px;
    }

    .train-cards.reverse {
        flex-direction: row-reverse;
    }

    .train-cards.reverse .train-card:first-child {
        margin-right: 0;
        margin-left: 0px;
        margin-bottom: 40px;
    }
}

@media screen and (min-width: 1920px) {

    h1 {
        font-size: 3.5em;
    }

    .main-station {
        font-size: 6.5rem;
    }

    .current-time {
        width: 16.5rem;
        padding: 20px 40px;
    }

    #hour {
        font-size: 4.2em;
    }

    .destination-name {
        font-size: 5.8em;
    }

    .next-train-label {
        font-size: 3em;
    }

    .time-remaining-large {
        font-size: 10em;
    }

    .next-trains-label {
        font-size: 3em;
    }

    .upcoming-time {
        font-size: 4.5em;
    }

    .train-card {
        padding: 50px 45px;
        max-width: 40rem;
    }

    .train-cards .train-card:first-child {
        margin-right: 40px;
    }

    .train-cards.reverse {
        flex-direction: row-reverse;
    }

    .train-cards.reverse .train-card:first-child {
        margin-right: 0;
        margin-left: 40px;
    }
}

@media screen and (min-width: 2560px) {
    h1 {
        font-size: 4.2em;
    }

    .main-station {
        font-size: 5.5rem;
    }

    .current-time {
        width: 20rem;
        padding: 25px 50px;
    }

    #hour {
        font-size: 5em;
    }

    .destination-name {
        font-size: 4.2em;
    }

    .next-train-label {
        font-size: 3em;
    }

    .time-remaining-large {
        font-size: 9.5em;
    }

    .next-trains-label {
        font-size: 3em;
    }

    .upcoming-time {
        font-size: 2.5em;
        padding: 18px 36px;
    }

    .train-card {
        padding: 60px 55px;
        max-width: 48rem;
    }
}

@media screen and (width: 1080px) and (height: 1920px) {
    .main-station {
        font-size: 6em;
    }

    .current-time {
        position: relative;
        width: 8.2em;
        font-size: 2.5em;
    }

    #hour {
        font-size: 2em;
    }

    .destination-name {
        font-size: 6.2em;
    }

    .next-train-label {
        font-size: 2.3em;
    }

    .time-remaining-large {
        font-size: 12.5em;
    }

    .next-trains-label {
        font-size: 2.3em;
    }

    .upcoming-time {
        font-size: 3em;
    }

    .train-card {
        width: 42em;
    }

    .train-cards .train-card:first-child {
        margin-bottom: 40px;
        margin-right: 0;
    }

    .train-cards.reverse .train-card:first-child {
        margin-left: 0;
    }
}