body {
    display: flex;
    background-color: #F8F9FD;
    font-family: 'Montserrat', sans-serif;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

h1 {
    color: #0b1e4a;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.btn-primary {
    background-color: #2F5DFE;
    border-color: #2F5DFE;
    color: #fff;
}

.btn-primary:hover {
    background-color: #4A76FF;
    border-color: #4A76FF;
    color: #fff;
}

.btn-danger {
    background-color: #BC4E46;
    border-color: #BC4E46;
    color: #fff;
}

.text-danger {
    color: #BC4E46 !important;
}

.btn-danger:hover {
    background-color: #a8433d;
    border-color: #a8433d;
}

/* navbar.html */

#sidebar {
    width: 12%;
    padding-top: 5%;
    position: fixed;
    top: 0;
    bottom: 0;
    height: 100vh;
    background-color: #0b1e4a;
    z-index: 1050;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
}

.login-card {
    max-width: 360px;
    margin: auto;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#loginModal .modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: 100vh;
}

@media (max-width: 768px) {
    #sidebar {
        padding-top: 12%;
        width: 70%;
        transform: translateX(-100%);
    }

    #sidebar.sidebar-visible {
        transform: translateX(0);
    }
}


#toggle-btn {
    background-color: transparent;
    border: none;
    box-shadow: none;
}

#toggle-btn:focus {
    outline: none;
    box-shadow: none;
    background-color: transparent;
}


.topbar-title {
    width: 8%;
    text-align: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 300;
    margin-left: 1rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    text-decoration: none;
}

#topbar {
    width: 100%;
    height: 3.5rem;
    background-color: #0b1e4a;
    color: white;
    position: fixed;
    top: 0;
    z-index: 1100;
    padding: 0 4.5%;
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    .topbar-title {
        font-size: 1rem;
        text-align: center;
        flex-grow: 1;
    }

    #topbar {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .dropdown {
        flex-shrink: 0;
    }
}

#content {
    margin-left: 15%;
    margin-top: 5%;
    width: 80%;
    transition: all 0.3s;
    max-height: 95%;
}

@media (max-width: 768px) {
    #content {
        margin: 10% auto 5% auto;
        width: 95%;
        max-width: 100%;
        padding: 0 2.5%;
    }
}

#sidebar.closed {
    margin-left: -20%;
}

#content.full {
    margin-left: 0;
    width: 100%;
}

.nav-item {
    position: relative;
}
.archive-submenu {
    background-color: #132b66 !important;
    padding-left: 1rem;
}

.archive-submenu,
.season-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.8s ease-in-out, padding 0.2s ease-in-out;
    padding-left: 1rem;
    padding-bottom: 0;
    background-color: #132b66;
}

.archive-submenu.open {
    max-height: 1000px;
    padding-bottom: 0.5rem;
}

.season-submenu.open{
    max-height: 200px;
    padding-bottom: 0.5rem;
}


#userMenuButton:focus {
    outline: none;
    box-shadow: none;
}
/* index.html */

#matches_close {
    width: 40%;
}

#matches_close h1 {
    margin-bottom: 10%;
}

#matches_close .card {
    transition: background-color 0.3s ease;
}

#matches_close .card:hover {
    background-color: #f2f2f2;
}

#summary_table{
    margin-left: 5%;
    margin-right: 5%;
    padding-top: 10%;
    min-width: 25%;
    max-width: 80%;
}

#news {
    width: 30%;
    max-height: 50%;
    border-style: solid;
    display: flex;
    flex-direction: column;
    padding-left: 1%;
    padding-right: 1%;
}

.content-index {
    display: flex;
    flex-direction: row;
}

.table-scroll {
    max-height: 100%;
    overflow-y: hidden;
    transition: overflow 0.2s ease;
    overscroll-behavior: contain;
}

.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.table-scroll:hover{
    overflow-y: auto;
}

@media (max-width: 768px) {
    .content-index {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    #matches_close,
    #summary_table,
    #news {
        width: 100% !important;
        margin: 0 auto 1rem auto;
    }

    #news {
        max-height: none;
        border: none;
        padding: 0;
    }

    #summary_table {
        padding-top: 1rem;
    }

    #matches_close h1 {
        margin-top: 3rem;
        margin-bottom: 1rem;
    }

    .table-scroll {
        max-height: none !important;
        overflow-y: visible !important;
    }
}

/* filter */

.filter {
    display: flex;
    flex-direction: row;
    padding-left: 60%;
}

.list-group-item.active {
    background-color: #2F5DFE !important;
    border-color: #2F5DFE !important;
    color: white !important;
}

/* match-detail */

#match_title {
    text-align: center;
    font-weight: 700;
    font-size: 2rem;
    color: #0b1e4a;
}

#match_info {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 10%;
    margin-top: 3%;
    margin-bottom: 3%;
    width: 70%;
    margin-left: auto;
    margin-right: auto;
}

#match_info div {
    margin-bottom: 8px;
    font-size: 1rem;
}

#match_info .label {
    font-weight: 600;
    color: #0b1e4a;
}

#btn-enter-result {
    display: block;
    margin: 0 auto;
}

table.table-bordered {
    width: 80%;
    margin: 0 auto;
    background-color: white;
}

caption {
    caption-side: top;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 10px;
}

#past_matches a {
    color: black;
    text-decoration: none;
}


#past_matches .list-group-item {
    font-size: 1rem;
    padding: 0.75rem 1rem;
}

#past_matches .list-group-item:hover {
    background-color: #f0f0f0;
    cursor: pointer;
}

#game_result_table {
    width: 70%;
    margin: 2rem auto;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.04);
    border-collapse: collapse;
    font-size: 0.95rem;
}

#game_result_table caption {
    caption-side: top;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.75rem;
    text-align: center;
    color: #222;
}

#game_result_table thead th {
    background-color: #2F5DFE;
    color: white;
    text-align: center;
}

#game_result_table th,
#game_result_table td {
    text-align: center;
    padding: 0.4rem 0.6rem;
    border: 1px solid #dee2e6;
    line-height: 1.2;
    vertical-align: middle;
}

#past_matches {
    width: 70%;
    margin: 0 auto;
    margin-top: 3%;
}

#past_matches .list-group-item.active {
    background-color: #2F5DFE;
    border-color: #2F5DFE;
    color: white;
    font-weight: 600;
}

#resultModal .modal-dialog {
    margin-top: 10%;
}
#resultForm .btn {
    min-width: 100px;
}

#team-home, #team-away {
    color: inherit;
    text-decoration: none;
}

#team-home:hover, #team-away:hover {
    text-decoration: underline;
    color: inherit;
}

@media (max-width: 768px) {
    #match_info {
        flex-direction: column;
        align-items: stretch;
        width: 90%;
    }

    #match_info .left_column,
    #match_info .right_column {
        width: 100%;
    }

    #match_info div {
        display: flex;
        justify-content: flex-start;
        margin-bottom: 1rem;
        flex-wrap: wrap;
    }

    #match_info .label {
        font-weight: 600;
        color: #0b1e4a;
        width: 40%;
        min-width: 120px;
        padding-right: 1rem;
    }

    #match_info span:not(.label) {
        width: 60%;
        flex-grow: 1;
        word-break: break-word;
        white-space: normal !important;
    }

    #past_matches {
        width: 95%;
    }

    .match-history-row span:nth-child(1) {
        width: 50%;
    }
    .match-history-row span:nth-child(2) {
        width: 35%;
    }
    .match-history-row span:nth-child(3) {
        width: 15%;
    }

}

/* team-detail */

.team-detail-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 3%;
    width: 100%;
    margin-top: 2%;
    flex-wrap: wrap;
}

#team_info {
    width: 50%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#team-image {
    width: 100%;
    max-height: 20em;
    object-fit: contain;
    margin-bottom: 1.5em;
    border: none;
    background-color: transparent;
}

#team_name {
    font-weight: bold;
    font-size: 170%;
    color: #0d2c54;
    margin-bottom: 1em;
}


#team_info .label {
    font-weight: bold;
    color: #0d2c54;
    display: inline-block;
    width: 10em;
}

#team_info button {
    margin-top: 2%;
    margin-right: 1em;
}

#list {
    width: 35%;
    margin-top: 5em;
}

#player_list td:last-child {
    text-align: right;
    width: 1%;
    white-space: nowrap;
}

#player_list button {
    margin-left: 0.3em;
}

#list h5 {
    font-size: 1.1em;
    color: #0d2c54;
    margin-bottom: 0.8em;
    border-bottom: 0.15em solid #0d6efd;
    padding-bottom: 0.2em;
    text-transform: uppercase;
}

.player-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6em 1em;
    margin-bottom: 0.4em;
    background-color: white;
    border: 0.05em solid #ccc;
}

.player-actions {
    display: flex;
    gap: 0.5em;
}

#addPlayerBtn {
    align-self: flex-end;
    margin-top: 1em;
}


.nav-admin,
.nav-player {
    display: none;
}

@media (max-width: 768px) {
    .team-detail-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    #team_info{
        margin-top: 10%;
        width: 100%;
    }

    #team_info {
        padding: 0 6%;
    }

    #team_info div {
        display: flex;
        flex-wrap: wrap;
        margin-bottom: 2%;
    }

    #team_info .label {
        font-weight: bold;
        color: #0d2c54;
        flex-shrink: 0;
        white-space: nowrap;
        margin-right: 2%;
        max-width: none;
        margin-bottom: 0.3rem;
    }

    #team_info span:not(.label) {
        word-break: break-word;
    }

    #team_info button {
        margin-top: 5%;
        width: 48%;
    }

    #editTeamBtn {
        margin-right: 4%;
    }

    #list {
        width: 100%;
        margin-top: 5em;
    }

}

/* standings */
.standings_table {
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}

/* schedule */

.type-select-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 100%;
}

#typeSelectSchedule {
    width: 25%;
    min-width: 15%;
}

.game-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

.game-row span {
    display: inline-block;
    width: 22%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.game-row span:first-child {
    width: 31%;
}

.game-row .teams {
    width: 35%;
}
.game-row .datetime {
    width: 17%;
}
.game-row .location {
    width: 20%;
}
.game-row .referee {
    width: 13%;
}
.game-row .status {
    width: 12%;
    text-align: right;
}

@media (max-width: 768px) {
    .game-row .teams,
    .game-row .datetime,
    .game-row .location,
    .game-row .referee,
    .game-row .status,
    .game-row span:first-child {
        width: 100% !important;
        text-align: left;
    }

    .game-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .game-row span {
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
        padding-right: 0;
    }

    #typeSelectSchedule {
        width: 100%;
    }
}

/* referees */

#referee-filter-wrapper {
    display: flex;
    justify-content: flex-end;
    gap: 2%;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

#referee-filter-wrapper select {
    width: 20%;
}

.referee-card span {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    padding-right: 0.5rem;
}

.referee-card .referee {
    width: 15%;
    font-weight: 700 !important;
}

.referee-card .teams {
    width: 35%;
}

.referee-card .location {
    width: 20%;
}

.referee-card .date {
    width: 15%;
    text-align: center;
}

.referee-card .time {
    width: 10%;
    text-align: right;
}

@media (max-width: 768px) {
    .referee-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.4rem;
    }

    .referee-card span {
        width: 100% !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: initial !important;
        padding-right: 0;
        text-align: left !important;
    }

    #referee-filter-wrapper select {
        width: 48%;
    }

}


/* teams */

#team_filter{
    width: 30%;
}

@media (max-width: 768px) {
    #team_filter{
        width: 55%;
    }

}

/* history */

#history-filter-wrapper {
    display: flex;
    justify-content: flex-end;
    gap: 2%;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

#seasonSelect,
#typeSelect {
    width: 100%;
}

/* files */

.file-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.file-link {
    background-color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #000;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: background-color 0.2s, box-shadow 0.2s;
    width: 50%;
}

.file-link:hover {
    background-color: #e6e6e6;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

/* calendar */

.fc-daygrid-day {
    background-color: white !important;
    border: 1px solid #dee2e6;
}

.fc .fc-daygrid-day-frame {
    padding: 0.3rem !important;
    min-height: 4rem !important;
}

.fc-col-header-cell-cushion {
    font-weight: 600;
    color: #0b1e4a;
    text-decoration: none;
}

.fc-event {
    background-color: #2196F3 !important;
    border: none !important;
    color: white !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.85rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fc-event-dot {
    display: none !important;
}

.fc-daygrid-event-dot {
    display: none !important;
}

.fc-toolbar-title {
    text-align: left !important;
    font-size: 1.6rem;
    font-weight: 700;
    margin-left: 0.5rem;
    color: #0b1e4a;
}

.fc .fc-button {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: white !important;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 0.25rem;
}

.fc .fc-button:hover {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
}

.fc-col-header-cell-cushion {
    font-weight: 600;
    color: #0b1e4a;
}

#calendar {
    max-width: 85%;
    margin: 0 auto;
}
.fc-day-other {
    background-color: #f2f2f2 !important;
}

.fc-day-other .fc-daygrid-day-number {
    color: #b0b0b0;
}

.fc-daygrid-day-top {
    justify-content: center !important;
}

.fc-daygrid-day-number {
    color: #6c757d;
    text-decoration: none !important;
    font-weight: 500;
}

#calendarExportDropdown{
    margin-right: 5rem;
}

/* team_schedule */
.game-row span {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    padding-right: 0.5rem;
}

.game-row .teams {
    width: 30%;
}
.game-row .datetime {
    width: 17%;
}
.game-row .location {
    width: 20%;
}
.game-row .referee {
    width: 15%;
}
.game-row .status {
    width: 13%;
    text-align: right;
}

.google-signin-wrapper .g_id_signin {
    display: inline-block;
    width: 100% !important;
    max-width: 500px;
}