:root {
    --font-primary: #00224D;
    --font-secondary: #ffffff;
    --font-text: #000000;
    --header_footer-bg: #f1ecec;
    --bg-primary: #00224D;
    --bg-secondary: #1560bc;
    --bg-third: #f1ecec;
    --bg-forth: #d6d3d3;
    --bg-fifth: #f66565;
    --bg-white: #FFFFFF;
    --button-primary: #f66565;
    --button-hover: #A0153E;
    --border-primary: #dad3d3;
    --border-secondary: #6e6d6d;
    --winning-bg-color: #4fd36e;
    --losing-bg-color: #f66565;
}

*, *::before, *::after {
    box-sizing: border-box;
    font-family: "Rubik", sans-serif;
    color: var(--font-text);
    border: none;
}

img {
    display: block;
    max-width: 100%;
}

figure {
    margin: 0;
    padding: 0;
}

h1, h2 {
    color: var(--font-primary);
}

h1 {
    font-size: clamp(1.5rem, 2rem, 2.5rem);
    margin: 0.5rem 0 1.5rem 0;
}

h2 {
    font-size: clamp(0.75rem, 1rem, 1.25rem);
    margin: 0 0 0.5rem 0;
}

p {
    margin: 0 0.5rem;
}

a {
    color: var(--font-primary);
    text-decoration: none;
    font-size: 1.25rem;
}

/* main structure */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

header, footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    background-color: var(--header_footer-bg);
    width: 100%;
}

main {
    overflow-y: scroll;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 1rem;
}

.main-bg {
    background: url("../bg_color.png");
}

.main__container {
    max-width: 1000px;
    width: 100%;
    background-color: var(--bg-white);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    padding: 1rem;
}

footer {
    padding: 0.25rem;
    justify-content: center;
}

/*components*/
.main__heading {
    display: flex;
    justify-content: center;
}

button {
    border-radius: 30px;
    background-color: var(--button-primary);
    width: 100%;
    outline: none;
    border: none;
    padding: 0.5rem;
}

button:hover {
    background-color: var(--button-hover);
    cursor: pointer;
    transition: background-color 0.3s
}

.btn-submit {
    margin: 0.5rem 0 0 0;
}


/* navigation */
.logo {
    border: 1px solid var(--border-primary);
    border-radius: 5px;
    margin: 0.25rem;
    padding: 0.25rem;
}

.logo p {
    font-size: 1.25rem;
    font-weight: 700;
}

.burger {
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 2rem;
    margin-right: 0.5rem;
}

.navbar {
    display: flex;
    align-items: center;
    width: 100%;
}

.nav__list {
    display: none;
    flex-direction: column;
    list-style-type: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.nav__list.show {
    display: flex;
}

.nav__item {
    text-align: center;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    justify-content: center;
}

.nav__item-logout:hover {
    background-color: initial;
}

.nav__item a {
    display: block;
    width: 100%;
    padding: 0.25rem 0;
    margin: 0;
    border-bottom: 1px solid var(--border-primary)
}

.nav__item__a-active {
    background-color: var(--bg-primary);
    color: var(--font-secondary);
}

.nav__item a:hover {
    background-color: var(--bg-secondary);
    color: var(--font-secondary);
    transition: background-color 0.3s
}

.btn-logout {
    margin: 0.25rem;
    padding: 0.25rem;
}

/*login*/
.main__login {
    padding: 1.5rem;
}

.container-login {
    max-width: 400px;
    max-height: 500px;
    padding-bottom: 0.5rem;
}

.heading-login {
}

.login-form {
    width: 100%;
    padding: 1rem 0;
}

.form__group {
    margin-bottom: 1.5rem;
}

.form__group label {
    margin-bottom: 0.5rem;
}

.login-form input {
    width: 100%;
    border-bottom: 1px solid var(--border-secondary);
    padding: 0.5rem
}

/* home */
.main__home {
}

.container-home {
    max-width: 600px;
}

.container-home p {
    margin: 0 0 1rem 0;
}

.container-home a {
    text-decoration: underline;
    font-size: inherit;
}

.container-home section {
    width: 100%;
}

.container-home ul {
    padding-left: 1rem;
}

.rules ul {
    margin-top: 0.25rem;
}

.rules li ul {
    margin: 0.15rem 0;
    padding-left: 1rem; /* Increase this value to adjust indentation */
}

.latestLogs__table {
    width: 100%;
    overflow: hidden;
}

.latestLogs__table table {
    width: 100%;
    border-collapse: collapse;
}

.latestLogs__table th, .latestLogs__table td {
    text-align: left;
    border-bottom: 1px solid #ddd;
    font-size: small;
}

.latestLogs__table th {
    background-color: #f2f2f2;
}


/* leaderboard */
.main__leaderboard {
}

.container-leaderboard {
    max-width: 600px;
}

.leaderboard__teams {
    width: 100%;
}

.team {
    background-color: var(--bg-third);
    border-radius: 5px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-secondary);
    overflow: hidden;
}

.team h2 {
    display: flex;
    justify-content: space-around;
    margin: 0;
    padding: 0.25rem 0;
}

.team h2 span {
    color: var(--font-primary);
}

.team ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    margin: 0.25rem 0.5rem;
}

.team ul li {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dotted var(--border-secondary);
}

.winners h2 {
    background-color: var(--winning-bg-color);
}

.losers h2 {
    background-color: var(--losing-bg-color);
}

.team-name, .team-points {
    padding: 0 0.5rem;
    word-wrap: anywhere;
}

.team-name {
    flex-grow: 1;
}

.user-name {
    text-align: left;
}

.user-points {
    text-align: right;
}

.points-development {
    width: 100%;
    border: 1px solid var(--border-secondary);
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.chart-container {
    position: relative;
    width: 100%;
    min-height: 300px;
    height: 300px;
}

#pointsChart {
    height: 100%;
    width: 100%;
}

.mvp {
    margin-bottom: 1.5rem;
    width: 100%;
}

.mvp h2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    color: var(--bg-third);
    background-color: var(--winning-bg-color);;
    border: 1px solid var(--border-secondary);
    border-radius: 5px;
    margin: 0;
}

.top-catch {
    margin-bottom: 1.5rem;
    width: 100%;
    overflow: hidden;
}

.top-catch article {
    margin-bottom: 1.5rem;
}

.top-catch .logbook__log .log__catches table {
    margin-top: 0;
}

.top-catch th {
    border-radius: 0 !important;
    border: none !important;
}

.top-catch td {
    border: none !important;
}

.top-catch tbody {
    border-radius: 0 0 5px 5px !important;
}

/* logbook */
.main__logbook {
}

.container-logbook {
    max-width: 600px;
    padding: 1rem 0.5rem;
}

.filter-container {
    position: sticky;
    top: calc(-1rem + (-3px));
    z-index: 2;
}

.filter-container form {
    border: 1px solid var(--border-secondary);
    border-radius: 5px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    background-color: var(--bg-primary);
    align-items: center;
}

.filter-container select {
    border-radius: 5px;
    margin: 0.25rem;
    padding: 0.1rem;
}

.filter-container button {
    margin: 0.25rem;
    padding: 0.1rem;
}

/* logs */
.logs-container {
    width: 100%;
}

.logbook {
    width: 100%;
}

.logbook__log {
    position: relative;
    border: 1px solid var(--border-secondary);
    border-radius: 5px;
    margin: 0.5rem 0;
}

.event__delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    border: none;
    border-radius: 100%;
    padding: 5px;
    font-size: 12px;
    width: auto;
}

.log__details {
    display: grid;
    grid-template-columns: 5fr 5fr 3fr 3fr;
    background-color: var(--bg-forth);
    border-radius: 5px 5px 0 0;
}

.log__details-item {
    display: flex;
    word-wrap: anywhere;
    flex-direction: column;
    margin: 0.25rem 0 0.25rem 0.5rem;
}

.log__label {
    font-size: 0.5rem;
}

.log__value {
    font-weight: bold;
    font-size: 0.75rem;
}

.log__description {
    white-space: normal;
    border-top: 1px solid var(--border-secondary);
    display: flex;
    align-items: center;
}

.log__description-item {
    display: flex;
    flex-direction: column;
    margin: 0.25rem 0.25rem 0.25rem 0.5rem;
}

.log__description .log__description-text {
    word-wrap: anywhere;
    white-space: normal;
    display: inline;
    font-size: 0.8rem;
}

.log__description p {
    margin: 0;
    padding: 0;
}

.log__catches {
    word-wrap: anywhere;
    border-top: 1px solid var(--border-secondary);
    white-space: normal;
}

.log__catches-item {
    display: flex;
    flex-direction: column;
    margin: 0.25rem 0.25rem 0.25rem 0.5rem;
}

.log__catches table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0.1rem;
}

.log__catches th,
.log__catches td {
    text-align: left;
    border-bottom: 1px solid var(--border-secondary);
    padding: 0.1rem 0.5rem 0 0.5rem;
}


.log__catches th {
    background-color: var(--bg-fifth);
    font-weight: bold;
    font-size: 0.75rem;
}

.log__catches td {
    background-color: var(--bg-third);
}

tbody tr {
    font-size: 0.8rem;
}

.log__catches th:first-child {
    border-top-left-radius: 5px;
}

.log__catches th:last-child {
    border-top-right-radius: 5px;
}

.log__catches tr:last-of-type td:first-of-type {
    border-bottom-left-radius: 5px;
}

.log__catches tr:last-of-type td:last-of-type {
    border-bottom-right-radius: 5px;
}

.log__catches th:nth-child(2),
.log__catches td:nth-child(2),
.log__catches th:nth-child(3),
.log__catches td:nth-child(3) {
    text-align: right;
    width: 15%;
    padding: 0.15rem;
    margin: 0.25rem;
}

.log__catches th:nth-child(4),
.log__catches td:nth-child(4) {
    text-align: right;
    width: 25%;
    padding: 0.15rem;
    margin: 0.25rem;
}

.log__pictures {
    word-wrap: anywhere;
    white-space: normal;
    display: flex;
    align-items: center;
}

.log__picture-item {
    display: flex;
    margin: 0 0 0.25rem 0.5rem;
    align-items: center;
}

.collapsible-container button {
    padding: 0 0.5rem;
    margin: 0;
    font-size: 0.75rem;
    background-color: inherit;
}

.collapsible-container button:hover {
    background-color: inherit;
}

.collapsible {
    border: none;
    text-align: left;
    outline: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    margin: 0;
    padding-left: 0;
}

.collapsible .triangle {
    font-size: 1rem;
    margin-right: 0.5rem;
    transition: transform 0.2s;
}

.collapsible.active .triangle {
    transform: rotate(90deg);
}

.content {
    padding: 0;
    display: none;
    border-radius: 5px;
    margin: 0 0.5rem;
}

.content p {
    text-align: center;
}

.log__images-container {
    text-align: center;
}

.click-for-large-view {
    font-weight: bold;
}

.log__images {
    display: grid;
    gap: 1rem;
    padding: 0.5rem 0;
    justify-content: start;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

.log__images-image {
    aspect-ratio: 1;
    width: 100%;
    height: auto;
    box-shadow: 3px 3px 3px grey;
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.3s;
}

.log__images-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.lightbox-navigation {
    position: absolute;
    top: 50%;
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: space-between;
}

.lightbox-button {
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    color: var(--bg-white);
    padding: 16px;
    cursor: pointer;
    width: auto;
}

.lightbox-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.log__images {
    position: relative;
}

.gallery-image {
    cursor: pointer;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
}

.pagination ul {
    list-style-type: none;
    padding: 0;
    margin: 0.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pagination ul li {
    margin: 0;
    padding: 0;
    display: inline-block;
}

.pagination ul li a {
    text-decoration: none;
    padding: 2px;
    border: 1px solid var(--border-secondary);
    border-radius: 3px;
    font-size: 0.75rem;
    margin: 0;
}

.pagination ul li a.active {
    background-color: var(--button-primary);
}

.pagination ul li a:hover {
    background-color: var(--button-hover);
}

/* upload */
.container-entry {
    max-width: 600px;
}

.container-entry label {
    margin: 0;
    font-weight: bold;
    color: var(--font-primary);
}

.container-entry input, .container-entry select, .container-entry textarea, .container-entry image {
    margin: 0.5rem 0 1rem 0;
    padding: 0.5rem;
    border: 1px solid var(--border-secondary);
    border-radius: 5px;
    background-color: var(--bg-third);
    width: 100%;
}

.container-entry select {
    padding: 0.5rem;
    margin: 0.5rem 0;
}

.entry__event__details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.entry__catch__details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 5px;
}

.entry__catch__entry {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px dotted var(--border-secondary);
    border-radius: 5px;
    padding: 0.25rem 0.5rem 0 0.5rem;
}

.entry__catch__entry div {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    justify-content: flex-end;
}

.entry__catch__entry label {
    flex-shrink: 0;
    text-align: left;
    padding-right: 1rem;
    width: auto;
}

.entry__catch__entry select,
.entry__catch__entry input {
    flex-grow: 1;
    flex-shrink: 1;
    padding: 0.25rem;
    margin: 0.25rem;
}

.add-button {
    display: flex;
    justify-content: flex-end;
    margin-right: 0.5rem;
}

.add-btn, .remove-btn {
    padding: 0.1rem 0.5rem;
    margin: 0 0.25rem 0.25rem 0;
    min-width: 100px;
    width: auto;
}

.entry__images {
    display: flex;
    border: 1px dotted var(--border-secondary);
    border-radius: 5px;
    align-items: flex-end;
    flex-direction: column;
    padding: 0.25rem;
}

.entry__images input[type="file"] {
    border: none;
    padding: 0;
    margin: 0;
}

.entry__images .remove-btn {
    margin: 0.25rem 0.5rem 0 0;
}

.entry__submit {
    margin: 1rem 0;
}

/* Responsive*/
@media screen and (min-width: 600px) {
    header {
        flex-wrap: nowrap;
    }

    .burger {
        display: none;
    }

    .navbar {
        display: flex;
        justify-content: flex-start;
    }

    .nav__list {
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
    }

    .nav__item {
        border: none;
        border-radius: 5px;
        padding: 0 0.25rem;
    }

    .nav__item a {
        border-bottom: none;
        border-radius: 5px;
        padding: 0.25rem;
    }

    .nav__item-logout {
        margin: 0 1rem 0 0;
    }

    .btn-logout {
        margin: 0;
        padding: 0.25rem 0.5rem;
    }

    .container-logbook {
        padding: 1rem 2rem;
    }

    .log__images {
        grid-template-columns: repeat(auto-fit, minmax(100px, 100px));
        justify-items: start;
        justify-content: start;
    }

    .entry__images {
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
    }

    .entry__images .remove-btn {
        margin: 0 0.5rem;
    }
}