* {
    box-sizing: border-box;
}

body {
    display: grid;
    grid-template-rows: 5rem 1fr 2rem;
    width: 100vw;
    height: 100vh;
    padding: 0;
    margin: 0;
    font-family: "Roboto", "Segoe UI", sans-serif;
    color: #fff;
    background: linear-gradient(180deg, #007500, transparent), linear-gradient(90deg, #0062b1, transparent), linear-gradient(-90deg, #f84300, transparent);
    background-blend-mode: screen;
    overflow: hidden;
}

header {
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid #fff3;
}

main {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden;
}

footer {
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    border-top: 1px solid #fff3;
}

a {
    color: #fff !important;
    text-decoration: none;
}

h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 300;
    text-align: center;
    padding: 1rem;
}

.buttons {
    display: flex;
    flex-direction: row;
    width: 20rem;
    height: 3rem;
    align-items: center;
    justify-content: center;
}

header h1 {
    font-size: 2rem;
}

header button {
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
}

header svg {
    width: 2rem;
    height: 2rem;
    fill: #fff;
}

header input {
    flex: 1;
    height: 2rem;
    border: none;
    border-radius: 1rem;
    max-width: 0;
    padding: 0;
    transition: all 0.3s ease;
}

footer p {
    font-size: 0.7rem;
    font-weight: 300;
}

table {
    width: 100%;
    table-layout: fixed;
    border-spacing: 0;
    background-color: #fff1;
}

tr {
    transition: background-color 0.3s ease;
}

tr:hover {
    background-color: #fff3;
}

tr.is-past {
    opacity: 0.3;
}

td {
    padding: 0.5rem;
}

tr:not(:last-child) td {
    border-bottom: 1px solid #fff3;
}

td>div {
    display: flex;
    flex-direction: row;
}

td>div>div:nth-child(2) {
    flex: 1;
}

.profile-img {
    width: 4rem;
    height: 4rem;
    float: left;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    border-radius: 5px;
    margin-right: 0.5rem;
    box-shadow: 0 0 1rem #0004;
}

.time {
    white-space: nowrap;
    text-transform: uppercase;
}

.title {
    text-transform: uppercase;
}

.performer {
    text-transform: uppercase;
    font-weight: 300;
}

.motto {
    font-size: 0.8rem;
    font-weight: 300;
    font-style: italic;
}

.details {
    font-size: 0.8rem;
    font-weight: 300;
}

.club-info {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.club-info .club-name {
    font-weight: 300;
}

.club-info img.pin {
    width: 2rem;
    height: 2rem;
    display: block;
}

#loader-wrapper {
    display: none;
    position: relative;
    top: 5rem;
    left: -2rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader {
    position: absolute;
    width: 4rem;
    aspect-ratio: 1;
}

.loader:before,
.loader:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    margin: -1rem 0 0 -1rem;
    width: 2rem;
    aspect-ratio: 1;
    background: #299db4;
    animation: l1-1 2s infinite, l1-2 .5s infinite;
}

.loader:after {
    background: #f77f1d;
    animation-delay: -1s, 0s;
}

@keyframes l1-1 {
    0% {
        top: 0;
        left: 0
    }

    25% {
        top: 100%;
        left: 0
    }

    50% {
        top: 100%;
        left: 100%
    }

    75% {
        top: 0;
        left: 100%
    }

    100% {
        top: 0;
        left: 0
    }
}

@keyframes l1-2 {

    80%,
    100% {
        transform: rotate(0.5turn)
    }
}

#current-events-wrapper {
    display: flex;
    flex-direction: column;
    flex-basis: calc(100% - max(16rem, 25%));
    flex-grow: 1;
    transition: flex-basis 0.3s ease, flex-grow 0.3s ease;
}

#event-list-wrapper {
    display: flex;
    flex-direction: column;
    flex-basis: max(16rem, 25%);
    flex-grow: 0;
    flex-shrink: 0;
    min-width: 0;
    padding: 0;
    position: relative;
    border-left: 1px solid #fff3;
    transition: flex-basis 0.3s ease, flex-grow 0.3s ease;
}

#current-events {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    padding: 0 1rem 1rem;
}

#events-scroll-wrapper {
    flex: 1;
    width: 100%;
    overflow-y: auto;
}

.enlarged-list #event-list-wrapper {
    padding: 0 2rem;
}

/* Enlarged list state */
.enlarged-list #current-events-wrapper {
    flex-basis: 14rem;
    flex-grow: 0;
}

.enlarged-list #event-list-wrapper {
    flex-basis: calc(100% - 14rem);
    flex-grow: 1;
}

/* Cards styles */
.cards {
    overflow-y: auto;
}

.card {
    position: relative;
    background-color: #fff1;
    border-radius: 5px;
    padding: 1rem 1rem 1.5rem;
    width: 12rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
}

.card:hover {
    background-color: #fff3;
}

.card .profile-img {
    float: none;
    margin: 0 0 1rem 0;
    width: 8rem;
    height: 8rem;
    box-shadow: 0 0 1rem #0008;
    transition: all 0.3s ease;
}

.card .title {
    font-weight: bold;
    white-space: normal;
}

.card .performer {
    margin-bottom: 0.5rem;
    white-space: normal;
}

.card .time {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.card .club-info {
    margin-top: auto;
    justify-content: center;
}

#toggle-width-btn {
    position: fixed;
    top: 50%;
    left: calc(100% - max(16rem, 25%));
    transform: translate(-50%, 50%);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(180deg, #7fba7fcc, transparent), linear-gradient(90deg, #7fb0d8cc, transparent), linear-gradient(-90deg, #fba17fcc, transparent);
    background-color: #000;
    background-blend-mode: screen;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: inset 0 0 0 1px #fff, 0 0 10px #0002;
    transition: left 0.3s ease, box-shadow 0.3s ease;
    opacity: 1;
}

#toggle-width-btn:hover {
    box-shadow: inset 0 0 0 1.5rem #fff, 0 0 10px #0002;
}

#content-container.enlarged-list #toggle-width-btn {
    left: 14rem;
}

#toggle-icon {
    fill: #fff;
    width: 1.5rem;
    height: 1.5rem;
    transition: transform 0.3s ease, fill 0.3s ease;
}

#toggle-width-btn:hover #toggle-icon {
    fill: #3abde6;
}

#content-container.enlarged-list #toggle-icon {
    transform: rotate(180deg);
}

/* Adjust table layout in narrow state (when list is 25%) */
#content-container:not(.enlarged-list) table {
    display: block;
}

#content-container:not(.enlarged-list) tbody {
    display: block;
    width: 100%;
}

#content-container:not(.enlarged-list) tr {
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

#content-container:not(.enlarged-list) td {
    padding: 0.2rem 0;
    border: none;
    width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
}

#content-container:not(.enlarged-list) tr:not(:last-child) {
    border-bottom: 1px solid #fff3;
}

/* List controls */
.list-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.list-controls button {
    width: 3rem;
    height: 3rem;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.list-controls button:hover {
    background: #fff3;
}

.list-controls svg {
    width: 2rem;
    height: 2rem;
    fill: #fff;
}

.list-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 1rem;
}

/* Tooltip */
.tooltip-container {
    position: relative;
}

.tooltip-container:hover .tooltip {
    display: block;
}

.tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
    background-color: #000c;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    white-space: normal;
    min-width: 150px;
    z-index: 100;
    pointer-events: none;
    font-size: 0.8rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    text-transform: none;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #000c transparent transparent transparent;
}

.info-icon {
    width: 1rem;
    height: 1rem;
    fill: #fff8;
    cursor: help;
    vertical-align: text-bottom;
    margin-left: 0.25rem;
}

.info-icon:hover {
    fill: #fff;
}

.region-info {
    display: flex;
    position: absolute;
    right: 0;
    bottom: 0;
    line-height: 1.2rem;
    text-align: center;
    font-size: 0.7rem;
}

.region-info>div {
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 3px;
    cursor: help;
}

.num-visitors {
    background-color: #fff3;
    color: #fff;
}

.region-rating {
    color: #fff;
}

.PG {
    background-color: #55bef3;
}

.M {
    background-color: #333;
}

.A {
    background-color: #ee4306;
}

#mobile-tabs {
    display: none;
}

/* Mobile Layout */
@media (max-width: 512px) {
    body {
        grid-template-rows: 5rem 3rem 1fr 2rem;
    }

    #mobile-tabs {
        display: flex;
        justify-content: center;
        background-color: #0004;
        border-bottom: 1px solid #fff3;
    }

    #mobile-tabs .tab-btn {
        flex: 1;
        background: transparent;
        color: #fff8;
        border: none;
        padding: 0.5rem 1rem;
        font-size: 1rem;
        cursor: pointer;
        text-transform: uppercase;
        border-bottom: 3px solid transparent;
        transition: all 0.3s ease;
    }

    #mobile-tabs .tab-btn.active {
        color: #fff;
        border-bottom-color: #3abde6;
    }

    #current-events-wrapper:not(.active),
    #event-list-wrapper:not(.active) {
        display: none !important;
    }

    #current-events-wrapper.active,
    #event-list-wrapper.active {
        flex-basis: 100% !important;
        max-width: 100%;
        border-left: none;
        flex-grow: 1;
    }

    #toggle-width-btn {
        display: none !important;
    }

    .enlarged-list #event-list-wrapper {
        padding: 0;
    }

    .card {
        width: 100%;
    }

    .header-container {
        flex-direction: column;
        padding-bottom: 0.5rem;
    }

    .header-container h1 {
        padding-bottom: 0.5rem;
    }

    .rating-filters {
        position: static;
        margin-top: 0.5rem;
    }
}

.header-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
}

.rating-filters {
    position: absolute;
    left: 1rem;
    display: flex;
    gap: 0.25rem;
}

.rating-btn {
    color: #fff;
    border: 1px solid #fff3;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    outline: none;
    transition: opacity 0.2s ease;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.2;
}

.rating-btn.active {
    opacity: 1;
}