/* Global reset and styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top of the page */
    height: 100vh;
    background-color: #f8f8f8;
    padding: 20px; /* Added padding to body to ensure content is not right at the edge */
}

/* Container for main content and sidebar */
.container {
    display: flex;
    gap: 20px; /* Adds space between the main content and sidebar */
    max-width: 1200px; /* Prevents container from stretching too wide */
    width: 100%;
    padding: 20px;
}

/* Main content area (left side with tables) */
.main-content {
    flex: 3; /* Takes up most of the space */
}

/* Sidebar area (right side for recent matches and add match result) */
.sidebar {
    flex: 1; /* Takes up less space */
    width: 600px;
    display: flex;
    flex-direction: column;
    gap: 20px; /* Adds space between the sections */
    padding: 20px;
    background-color: #f4f4f4;
    border-radius: 8px;
}

/* Rank table styling */
.rank-table {
    width: 600;
    overflow-x: auto; /* Ensures the table doesn't overflow the container */
}

.rank-table h2 {
    text-align: center;
    margin-bottom: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid black;
}

th, td {
    border: 2px solid black;
    padding: 10px;
    text-align: left;
}

th:nth-child(1), td:nth-child(1) { /* Rank column */
    width: 50px;
    text-align: center;
}

th:nth-child(2), td:nth-child(2) { /* Elo column */
    width: 80px;
    text-align: center;
}

th:nth-child(3), td:nth-child(3) { /* Elo column */
    width: 80px;
    text-align: center;
}

th:nth-child(4), td:nth-child(4) { /* Elo column */
    width: 80px;
    text-align: center;
}

th:nth-child(5), td:nth-child(5) { /* Name column */
    width: auto; /* Expands to fill remaining space */
}

th {
    background-color: #ddd;
}

/* Styling for recent matches and add match result */
.recent-matches, .match-result {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

h3 {
    text-align: center;
    border-bottom: 2px solid black;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

/* Match result form styling */
input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Player dropdowns styling */
#playerSelection1v1, #playerSelection2v2 {
    margin-top: 15px;
}

#playerSelection1v1 select, #playerSelection2v2 select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.match-buttons {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
}

.player-selection {
    margin-top: 15px;
}

/* Style for player selection container */
.player-selection {
    margin-top: 15px;
}

/* Flexbox layout to align dropdown and score input */
.player-row {
    display: flex;
    flex-direction: column; /* Stack items vertically */
    align-items: flex-start;
    margin-bottom: 20px; /* Adds space between player rows */
}

/* Styling for dropdowns */
.player-row select {
    flex: 2; /* Allows dropdowns to take most of the width */
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 8px; /* Adds space below dropdown */
    width: 100%;
}

/* Styling for number inputs */
.player-row input[type="number"] {
    flex: 1; /* Allows score input to be smaller */
    padding: 10px; /* Adds padding inside the input */
    margin-top: 5px; /* Adds space above */
    margin-bottom: 5px; /* Adds space below */
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
    width: 80px; /* Set fixed width for scores */
}
.score-label {
    font-weight: bold;
    margin-bottom: 4px;
}
.submit-button {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.submit-button button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}