* {
  box-sizing: border-box;
}

body {
    background-color: rgb(226, 226, 226);
    margin: 0;
    margin-bottom: 50px;
    font-family: Arial, sans-serif;
}

#scores {
    width: 100%;
    height: 125px;
    position: inherit;
}

.alert {
  padding: 20px;
  margin: auto;
  width: 50%;
  background-color: #ffbb00;
  color: black;
  border: 2px solid black;
  border-radius: 14px;
}

.closebtn {
  margin-left: 15px;
  color: black;
  font-weight: bold;
  float: right;
  font-size: 32px;
  line-height: auto;
  cursor: pointer;
  transition: 0.3s;
}

.closebtn:hover {
  color: black;
}

/* Locator Bar */
#Locator-bar {
    background-color: rgb(43, 44, 45); 
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 40px;
    width: 100%;
    position: absolute; 
    overflow: visible; /* Ensure the slant is fully visible */
    z-index: 1;
    padding-left: 100px; /* Move the entire content of the Locator bar to the right */
}

/* Logo Container (Holds the "CSN" text and slant) */
.logo-container {
    position: relative;
    z-index: 2;
    margin-left: 0px; /* Space between logo and buttons */
    height: 100%;
    display: flex;
    justify-content: center; /* Centers content horizontally */
    align-items: center; /* Centers content vertically */
}

/* CSN Text */
.logo {
    color: white;
    z-index: 3; 
    position: relative; 
    width: 100px;
    height: 100px;
    left: -58%; /* Push slant to the right with a 75% margin */
}

/* Red slanted background behind "CSN" text but in front of Locator Bar */
.logo-container::before {
    content: '';
    position: absolute;
    top: 0; /* Start the slant at the very top */
    left: -75%; /* Push slant to the right with a 75% margin */
    width: 125%; /* Adjusted width */
    height: 100%; /* Full height */
    background-color: #d00;
    transform: skewX(-28deg); /* Apply slant effect */
    z-index: 0;
    border-left:10px solid #b40000;
    border-right: 10px solid #b40000;
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: -100px;
    z-index: 10; /* Ensure buttons are above background */
}

.nav-btn {
    background-color: transparent;
    color: white; /* Button text color is white */
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: normal;
    border: none; /* Removed border from buttons */
}

.nav-btn:hover {
    background-color: transparent;
    color: red; /* Button text turns red on hover */
    text-decoration: underline;
    font-style: italic;
}

/* Dropdown Menu */
.dropdown {
    position: relative; /* To position the dropdown content */
    z-index: 999; /* Make sure dropdown container stays on top */
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: black;
    min-width: 160px;
    z-index: 9999; /* Ensure dropdown content appears on top */
    top: 100%; /* Position dropdown directly below the "INFORMATION" button */
    left: 0;
    margin-top: 0px; /* Add a small margin to prevent it from touching the button */
}

.dropdown:hover .dropdown-content {
    display: block; /* Make the dropdown content visible on hover */
}

.dropdown-btn {
    background-color: transparent;
    color: white;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    font-weight: normal;
    border: none;
}

.dropdown-btn:hover {
    background-color: transparent;
    color: red;
    text-decoration: underline;
    font-style: italic;
}

#body {
    width: 85%;
    background-color: white;
    border-radius: 15px;
    margin: auto;
    padding-top: 0px;
    padding-bottom: 15px;
    padding-left: 0px;
    padding-right: 0px;
    text-align: center;
}

/* Hamburger Button */
.hamburger {
    position: fixed;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Hamburger Bars */
.bar {
    width: 30px;
    height: 4px;
    background: white;
    transition: 0.3s;
}

/* Sidebar Menu */
.sidebar {
    position: fixed;
    top: 6%;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 10);
    display: flex;
    align-items: top;
    transition: 0s;
    overflow: scroll;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    text-align: left;
    width: 100%;
}

.sidebar ul li {
    border-bottom: 1px solid gray;
    line-height: 70px;
}

.sidebar ul li a {
    color: black;
    text-decoration: none;
    font-size: 30px;
    transition: 0s;
    padding: 15px;
}

.sidebar ul li a:hover {
    color: red;
    text-decoration: underline;
    font-style: italic;
}

/* Active Sidebar */
.sidebar.active {
    left: 0;
}

/* Transform Hamburger into 'X' */
.hamburger.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(8px, 7px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

#school {
    text-align: left;
    font-size: 28px;
}

#sport {
    text-align: left;
    font-size: 20px;
    margin-top: -35px;
}

#sport-header {
    width: 100%;
    box-shadow: 0px 1px 3px 0px #888888;
    border-top-right-radius: 15px;
    border-top-left-radius: 15px;
    padding: 15px;
    padding-top: 0px;
    padding-bottom: 0px;
    border: none;
}

#school-header {
    width: 100%;
    box-shadow: 0px 1px 3px 0px #888888;
    border-top-right-radius: 15px;
    border-top-left-radius: 15px;
    padding: 15px;
    padding-top: 0px;
    padding-bottom: 0px;
    border: none;
}

#coach {
    text-align: left;
    font-size: 15px;
    margin-top: -30px;
}

@media only screen and (max-width: 1085px) {
    body { margin: 0px; }

    .nav-links {
        display: none;
    }

    .logo {
        display: none;
    }

    .logo-container {
        width: 12%;
        content: '';
        position: absolute;
        top: 0; /* Start the slant at the very top */
        left: 5%; /* Push slant to the right with a 5% margin */
    }

    #navigation-bar {
        position: fixed;
    }

    #scores {
        display: none;
    }

    #body {
        position: relative;
        top: 50px !important;
        left: auto;
        right: auto;
    }

    #body .alert {
        width: 85%;
    }
}

@media only screen and (min-width: 1086px) {
    #menuToggle {
        display: none;
    }
    #body {
        margin-top: 75px !important; /* Adjust for desktop */
    }
}

/* User icon dropdown styles */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-icon {
    font-size: 28px !important;
    color: #fff;
    cursor: pointer;
    padding: 10px;
}

.user-menu {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    right: 0;
    min-width: 120px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 6px;
    overflow: hidden;
}

.user-menu a {
    color: black;
    padding: 10px 12px;
    text-decoration: none;
    display: block;
    font-size: 14px;
}

.user-menu a:hover {
    background-color: #f1f1f1;
}

.user-dropdown:hover .user-menu {
    display: block;
}

/* Position icon to far right */
.nav-user-icon {
    margin-left: auto;
    display: flex;
    align-items: center;
}

        /* Mobile-friendly styles */
        @media screen and (max-width: 768px) {
            #schedule-holder, #roster-holder, #add_player_and_header {
                width: 95% !important;
            }

            .nav-links {
                display: none;
            }

            .sidebar {
                width: 100%;
            }

            table {
                display: block;
                overflow-x: auto;
                white-space: nowrap;
            }

            td, th {
                padding: 8px 4px;
                font-size: 14px;
            }

            #sport-header {
                padding: 10px;
            }

            .tabs {
                flex-wrap: wrap;
                gap: 4px;
            }

            .tab-button {
                padding: 5px;
                font-size: 14px;
            }

            .popup-content input, select {
                width: 90%;
                font-size: 16px;
                height: 35px;
            }

            #player-popup, #game-popup, #Coach-popup {
                width: 90% !important;
            }

            #add-game-btn, #add-player-btn {
                width: 100%;
                margin-bottom: 10px;
            }
        }

        #popup {
            display: none;
            position: fixed;
            top: 30%;
            left: 50%;
            transform: translate(-50%, -30%);
            padding: 20px;
            background: #f0f0f0;
            border: 2px solid #333;
            border-radius: 10px;
            box-shadow: 0px 0px 10px #000;
            z-index: 1000;
            text-align: center;
        }

        #overlay {
            display: none;
            position: fixed;
            top: 0; left: 0;
            width: 100%; height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 999;
        }

        .page-header {
            font-size: 40px;
            padding: 10px;
            font-weight: bold;
            border-bottom: 1px solid #ccc;
        }

        table {
            border-collapse: collapse;
            width: 100%;
            margin: auto;
        }

        table, th, td {
            border: none; /* removes lines */
        }

        th, td {
            padding: 10px 8px;
            text-align: left;
        }

        tr:not(:last-child) {
            border-bottom: 1px solid #ccc; /* optional: light horizontal divider */
        }

        /* New CSS for positioning the button */
        #sport-header {
            position: relative;
        }

        #claim_coach_btn {
            position: absolute;
            top: 20;
            right: 15;
            padding: 10px 15px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }

        #schedule-header {
            text-align: left;
        }

        #roster-header {
            text-align: left;
        }

        #schedule-holder {
            width: 75%;
            margin: auto;
        }

        #roster-holder {
            width: 75%;
            text-align: left;
        }

        .tabs-container {
            display: flex;
            align-items: flex-start;
            justify-content: flex-start;
            gap: 20px;
        }

        .tabs {
            padding-bottom: 5px;
            display: flex;
            gap: 8px;
            max-width: 300px;
        }

        .tab-button {
            padding: 3px 8px;
            font-size: 15px;
            border: 1px solid black;
            border-radius: 5px;
            background-color: white;
            font-weight: bold;
            cursor: pointer;
            white-space: nowrap;
            width: auto;
        }

        .tab-button:hover {
            background-color: #ccc;
        }

        td form {
            display: inline; /* Try inline instead of inline-block */
            margin: 0;
            padding: 0;
        }

        td button {
            vertical-align: middle;
            padding: 4px 8px;
            font-size: 14px;
            line-height: 1.4;
        }

        .tab-button.active {
            background-color: #d80303;
            color: white;
        }

        .content {
            flex-grow: 1;  /* Let content take up remaining space */
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        #add-player-btn {
            display: flex;
            align-items: flex-start;
            justify-content: flex-start;
            color: black;
            background-color: white;
            border: 1px solid black;
            border-radius: 5px;
            padding: 8px 15px;
        }

        #add-player-btn:hover {
            color: white;
            background-color: #d80303;
            cursor: pointer;
        }

        #add-game-btn {
            display: flex;
            align-items: flex-start;
            justify-content: flex-start;
            color: black;
            background-color: white;
            border: 1px solid black;
            border-radius: 5px;
            padding: 8px 15px;
        }

        #add-game-btn:hover {
            color: white;
            background-color: #d80303;
            cursor: pointer;
        }

        #school-img {
            max-width: 75px;
        }

        #game-delete, #player-delete {
            background-color: white;
            color: black;
            border: 2px solid #d80303;
            border-radius: 5px;
            padding: 5px 10px;
            width: 80px;
            white-space: nowrap;
        }

        #game-edit, #player-edit {
            background-color: white;
            color: black;
            border: 2px solid orange;
            border-radius: 5px;
            padding: 5px 10px;
        }

        #game-delete:hover, #player-delete:hover {
            background-color: red;
            color: white;
            border: 2px solid black;
            cursor: pointer;
        }

        #game-edit:hover, #player-edit:hover {
            background-color: orange;
            border: 2px solid black;
            cursor: pointer;
        }

        #game-save {
            background-color: white;
            color: black;
            border: 2px solid green;
            border-radius: 5px;
            padding: 5px 10px;
        }

        #game-save:hover {
            background-color: green;
            color: white;
            cursor: pointer;
        }

        #player-save {
            background-color: white;
            color: black;
            border: 2px solid green;
            border-radius: 5px;
            padding: 5px 10px;
        }

        #player-save:hover {
            background-color: green;
            color: white;
            cursor: pointer;
        }

        #add_player_and_header {
            width: 75%;
            margin: auto;
        }

        #player-popup-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 999;
        }

        #player-popup {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
            z-index: 1000;
            width: 35%;
        }

        #Coach-popup-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 999;
        }

        #Coach-popup {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
            z-index: 1000;
            width: 35%;
        }

        #player-popup .popup-content {
            text-align: center;
        }

        #game-popup-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 999;
        }

        #game-popup {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
            z-index: 1000;
            width: 50%;
        }

        #game-popup .popup-content {
            text-align: center;
        }

        #drop, #remove-coach {
            background: none;
            color: red;
            font-weight: bold;
            text-decoration: none;
            border: none;
        }

        #drop:hover, #remove-coach:hover {
            text-decoration: underline;
            font-style: italic;
            cursor: pointer;
        }

        .popup-content input, select {
            background-color: white;
            color: black;
            padding: 5 10;
            border: 2px solid black;
            margin: 5px;
            width: 80%;
            height: 45px;
            font-size: 25px;
        }

        .popup-content #add {
            background-color: green;
            color: white;
            border: 2px solid green;
            border-radius: 5px;
            padding: 10 8;
            margin: 15px;
            font-weight: bold;
            width: 175px;
        }

        .popup-content #add:hover {
            background-color: white;
            color: black;
            border: 2px solid green;
            cursor: pointer;
        }

        .popup-content #cancel {
            background-color: red;
            color: white;
            border: 2px solid red;
            border-radius: 5px;
            padding: 10 8;
            margin: 15px;
            font-weight: bold;
            width: 175px;
        }

        .popup-content #cancel:hover {
            background-color: white;
            color: black;
            border: 2px solid red;
            cursor: pointer;
        }

        #UserFound {
            color: white;
            background-color: green;
            text-align: left;
            padding: 10px;
            margin: 10px;
            font-weight: bold;
        }

        #UserNotFoundMsg {
            color: white;
            background-color: red;
            text-align: left;
            padding: 10px;
            margin: 10px;
            font-weight: bold;
        }

        #GameAdded {
            color: white;
            background-color: green;
            text-align: left;
            padding: 10px;
            margin: 10px;
            font-weight: bold;
        }

        #Coach_edit_pos {
            color: black;
            background-color: white;
            border: 1px solid black;
            border-radius: 5px;
        }

        #Coach_edit_pos:hover {
            background-color: orange;
            cursor: pointer;
        }

#schedule-holder table th,
        #schedule-holder table td,
        #roster-holder table th,
        #roster-holder table td,
        #coaches-holder table th,
        #coaches-holder table td,
        #scores-holder table th,
        #scores-holder table td {
            padding: 8px;
            overflow: visible;
            white-space: normal;
            word-wrap: break-word;
            font-size: 14px;
        }

        /* Scores tab styles */
        .scores-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 20px;
            padding: 20px;
        }

        .score-card {
            background: white;
            border-radius: 10px;
            padding: 15px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            transition: transform 0.2s;
        }

        .score-card:hover {
            transform: translateY(-5px);
        }

        .game-date {
            text-align: center;
            font-size: 0.9em;
            color: #666;
            margin-bottom: 10px;
        }

        .teams-container {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin: 15px 0;
        }

        .team {
            text-align: center;
            flex: 1;
        }

        .team-logo {
            width: 60px;
            height: 60px;
            margin: 0 auto 10px;
        }

        .team-logo img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .team-name {
            font-size: 0.9em;
            margin-bottom: 5px;
        }

        .team-name a {
            color: inherit;
            text-decoration: none;
        }

        .team-name a:hover {
            color: red;
            text-decoration: underline;
            font-style: italic;
        }

        .team-score {
            font-size: 1.8em;
            font-weight: bold;
        }

        .vs {
            margin: 0 10px;
            color: #666;
            font-weight: bold;
        }

        .game-result {
            text-align: center;
            margin-top: 10px;
        }

        .win {
            color: green;
            font-weight: bold;
            font-size: 1.2em;
        }

        .loss {
            color: red;
            font-weight: bold;
            font-size: 1.2em;
        }