/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f0f4f8; /* Light blue-gray background */
    color: #333; /* Dark gray text */
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Hide logged-in-only items by default */
.logged-in-only {
    display: none;
}

/* Form styling */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="file"] {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

button[type="submit"] {
    background-color: #007acc; /* Teal */
    color: #fff; /* White text */
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

button[type="submit"]:hover {
    background-color: #005f99; /* Slightly darker teal on hover */
}

/* Centered form group and bigger dropdown */
.form-group.centered {
    text-align: center;
    margin-bottom: 20px;
}

#tournamentSelect.big-dropdown {
    width: 50%;
    padding: 10px;
    font-size: 1.2rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 0 auto;
    display: block;
}

/* Common table styles */
.table-common {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: #fff; /* White background */
}

.table-common th, .table-common td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table-common th {
    background-color: #007acc; /* Teal table header */
    color: #fff; /* White header text */
    font-size: 1.2rem;
}

.table-common td {
    padding: 12px;
}

.match-row {
    transition: background-color 0.3s ease;
}

.match-row:hover {
    background-color: #e0f7fa; /* Light teal background on hover */
}

.match-row.win td:nth-child(2),
.match-row.draw td:nth-child(2),
.match-row.draw td:nth-child(3),
.match-row.lose td:nth-child(3) {
    font-weight: bold;
}

/* Header styles */
header {
    background-color: #007acc; /* Teal header background */
    color: #fff; /* White header text */
    padding: 10px 0;
    text-align: center;
    position: relative; /* Ensure relative positioning for child elements */
    width: 100%;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    word-wrap: break-word; /* Prevent text overflow on small screens */
}

.auth-buttons {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#loginBtn, #registerBtn, #logoutBtn {
    background-color: #005f99; /* Dark teal */
    color: #fff; /* White text */
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin: 5px 0; /* Adjust spacing between buttons */
}

#loginBtn:hover, #registerBtn:hover, #logoutBtn:hover {
    background-color: #004766; /* Slightly darker teal on hover */
}

.hamburger-menu {
    position: absolute;
    top: 20px;
    left: 20px; /* Adjusted position to top left */
    cursor: pointer;
    z-index: 1000;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #fff; /* White menu bar */
    margin: 5px 0;
}

.nav-menu {
    display: none;
    position: absolute;
    top: 60px;
    left: 20px; /* Adjusted position for the menu items */
    background-color: rgba(0, 122, 204, 0.9); /* Teal menu background with transparency */
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 900;
}

.nav-menu ul {
    list-style-type: none;
    padding: 0;
}

.nav-menu ul li {
    margin-bottom: 10px;
}

.nav-menu ul li a {
    text-decoration: none;
    color: #fff; /* White menu text */
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.nav-menu ul li a:hover {
    color: #f0f4f8; /* Light blue-gray hover color */
}

/* Main content section */
.flex-container {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    flex-wrap: wrap;
}

#playerRankings, #recentMatches, #matchHistory, #playerStandings {
    flex: 1;
    margin-right: 20px;
    min-width: 300px;
    margin-bottom: 20px;
    background-color: #fff; /* White background */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#playerRankings, #recentMatches, #matchHistory, #playerStandings .table-common {
    margin-top: 0;
    margin-bottom: 20px;
}

h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    border-bottom: 2px solid #007acc; /* Teal border under headings */
    padding-bottom: 10px;
}

ul {
    list-style-type: none;
    padding: 0;
}

/* Player rankings list */
#rankingsList li {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
    background-color: #e0f7fa; /* Light teal background */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
}

.kanji-symbol {
    margin-right: 10px;
    font-size: 1.5rem;
}

/* Players table */
.players-table, .matches-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: #fff; /* White background */
}

.players-table th, .players-table td, .matches-table th, .matches-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.players-table th, .matches-table th {
    background-color: #007acc; /* Teal table header */
    color: #fff; /* White header text */
    font-size: 1.2rem;
}

.players-table td, .matches-table td {
    padding: 12px;
}

.players-table .profile-pic {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

/* Search box */
#searchBox {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Footer styles */
footer {
    background-color: #005f99; /* Dark teal footer background */
    color: #fff; /* White footer text */
    text-align: center;
    padding: 10px 0;
    position: relative;
    width: 100%;
    margin-top: auto;
}

/* Responsive styles */
@media (max-width: 768px) {
    .flex-container {
        flex-direction: column;
        align-items: center;
    }

    #playerRankings, #recentMatches, #matchHistory, #playerStandings {
        margin-right: 0;
        margin-bottom: 20px;
    }

    .nav-menu {
        left: 10px;
    }

    .hamburger-menu {
        left: 20px;
    }

    .auth-buttons {
        top: 60px;
        right: 0;
        width: 100%;
        text-align: center;
        position: static;
        margin-top: 10px;
    }

    #loginBtn, #registerBtn, #logoutBtn {
        width: 90%;
        margin: 5px auto;
    }

    header h1 {
        font-size: 2rem;
        margin-bottom: 5px;
    }

    /* Table styles for small screens */
    .table-common, .players-table, .matches-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Adjust font sizes and padding for smaller screens */
    .table-common th, .table-common td,
    .players-table th, .players-table td,
    .matches-table th, .matches-table td {
        padding: 8px;
        font-size: 0.9rem;
    }

    /* Reduce padding for form elements */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="file"],
    button[type="submit"] {
        padding: 8px;
        font-size: 0.9rem;
    }

    /* Adjust container padding for smaller screens */
    .container {
        padding: 10px;
    }

    /* Adjust form group margins */
    .form-group {
        margin-bottom: 15px;
    }

    /* Adjust search box padding */
    #searchBox {
        padding: 8px;
        font-size: 0.9rem;
    }
}

/* Player Registration Form styles */
.main-container {
    padding: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .players-table .profile-pic {
        width: 75px;
        height: 75px;
    }
}
