:root {
    --trip-data-width: 55%;
    --trip-overview-width: calc(100% - 3px - var(--trip-data-width));
    --ticket-background: linear-gradient(135deg, #45449e, #1e3c74);
    --alternatives-background: linear-gradient(180deg, #45449e, #1e3c74);
}

.trip-overview {
    width: 100%;
    height: calc(100% - 2em);
    display: flex;
    flex-direction: row;
    gap: min(2.5vw, 2.5em);
    position: absolute;
    top: 1em;
}

main {
    overflow: hidden;
}

.error {
    border: 2px solid red;
}

.trip-overview hr {
    border: none;
    background-color: #dddddd;
    height: calc(100% - 2em);
    width: 3px;
    position: relative;
    top: 5px;
    border-radius: var(--standard-border-radius);
}

.trip-data {
    display: flex;
    flex-direction: column;
    width: var(--trip-data-width);
}

.trip-img-container {
    aspect-ratio: 5 / 4;
    margin: min(5px, 1vw, 1vh);
    margin-left: 0;
    width: 100%;
}

.trip-img-container #trip-img {
    position: relative;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    z-index: 5;
}

.trip-img-container #trip-img-attribution {
    position: relative;
    bottom: calc(1em + 3px);
    right: 3px;
    width: calc(100% - 6px);
    text-align: right;
    z-index: 10;
    display: block;
    font-size: 1em;
    line-height: 1;
    color: #dddddd;
    text-decoration: underline;
}

.trip-title {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding-bottom: 5px;
}

.trip-title #trip-route {
    color: #ffffff;
    font-weight: 700;
    position: relative;
    line-height: 1;
    font-size: 1.85em;
    width: 80%;
}

#trip-alternatives {
    margin: 5px 0;
    width: 80%;
    display: flex;
    height: 1.85em;
    line-height: 1;
    gap: 3px;
}

#trip-alternatives button {
    flex: 1;
    cursor: pointer;
    font-size: 0.75em;
    border: none;
    background: var(--alternatives-background);
    color: #cccccc;
    font-weight: 500;
}

#trip-alternatives > button:first-child {
    border-top-left-radius: calc(var(--standard-border-radius) / 1.5);
    border-bottom-left-radius: calc(var(--standard-border-radius) / 1.5);
}
#trip-alternatives > button:last-child {
    border-top-right-radius: calc(var(--standard-border-radius) / 1.5);;
    border-bottom-right-radius: calc(var(--standard-border-radius) / 1.5);;
}

#option-btns {
    height: 1.85em;
    display: flex;
    gap: 1em;
}

#option-btns * {
    background: transparent;
    border: none;
    cursor: pointer;
}

#option-btns * img {
    height: 1.85em;
}

#flags {
    overflow-x: scroll;
    overflow-y: hidden;
    max-height: 24px;
    display: flex;
    flex-direction: row;
    gap: 4px;
    margin: 5px 0;
}

#tickets-overview {
    width: var(--trip-overview-width);
}

.tickets-title {
    display: block;
    width: 100%;
    color: #ffffff;
    text-align: center;
    font-size: 2em;
    font-weight: 700;
    line-height: 1;
    padding-bottom: min(0.5em, 3px);
}

#tickets-overview hr {
    width: 90%;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    height: 3px;
}

#tickets {
    width: calc(90% - 10px);
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 1.25em;
    padding: 5px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 3em - min(0.5em, 3px) - 3px);
    overflow-x: hidden;
    overflow-y: scroll;
    gap: min(1.75vw, 1.75vh, 1.75em);
}

#tickets .ticket {
    width: calc(100% - 6px);
    aspect-ratio: 4/1;
    display: flex;
    flex-direction: row;
    background: var(--ticket-background);
    border-radius: var(--standard-border-radius);
    border: 2px solid white;
    padding: 3px;
    gap: 1.25em;
    justify-content: space-between;
}

.ticket .ticket-data {
    width: calc(60% - 1.25em);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.ticket-data .ticket-route {
    color: #ffffff;
    font-size: 1.25em;
    line-height: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 4px;
}

.ticket-route .ticket-location {
    height: 1.25em;
    width: 100%;
    display: flex;
    gap: 2px;
}

.ticket-location img {
    height: 100%;
    width: 1.25em;
}

.ticket-location p {
    flex: 1;
}

.ticket-data .ticket-date {
    height: 1.5em;
    font-size: 1.25em;
    cursor: pointer;
    width: 100%;
    height: 1.25em;
    display: flex;
    gap: 2px;
}

.ticket-date img {
    height: 1.25em;
    width: 1.25em;
}

.ticket-date input {
    width: calc(100% - 1.25em - 2px);
}

.ticket .ticket-btn {
    background: rgb(27, 139, 51);
    border-radius: var(--standard-border-radius);
    border: none;
    cursor: pointer;
    color: #ffffff;
    height: 35%;
    aspect-ratio: 7/2;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    font-size: 1.05em;
    line-height: 1;
    align-items: center;
    padding: min(5px, 1em);
    align-self: flex-end;
    margin: 3px;
}

.ticket-btn img {
    height: 90%;
    aspect-ratio: 1/1;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-aspect-ratio: 1/1) {
    :root {
        --trip-data-width: 100%;
        --trip-overview-width: 100%;
    }

    .trip-overview {
        flex-direction: column;
        gap: min(5vw, 2.5em);
    }

    .trip-overview hr {
        width: 100%;
        height: 3px;
    }

    main {
        overflow-y: scroll;
    }

    #trip-alternatives {
        width: 100%;
    }
    
    .trip-title #trip-route {
        font-size: 1.5em;
    }

    .ticket-data .ticket-route {
        font-size: 1em;
    }
}