/* GLOBAL ------------------------------------------------------- */

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #121212;
    color: white;
}

/* HEADER BAR --------------------------------------------------- */

.header-bar {
    background-color: #003f91;   /* Blue Header (default) */
    padding: 20px;
    text-align: center;
    color: white;
    font-size: 26px;
    font-weight: bold;
}

.header-admin {
    background-color: #8B0000 !important;  /* Deep red in Admin mode */
}

/* SEASON DROPDOWN ---------------------------------------------- */

.season-select {
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 4px;
}

/* SECTION TITLE ------------------------------------------------ */

.section-title {
    margin-top: 15px;
    font-size: 22px;
    text-align: center;
    font-weight: bold;
}

/* BUTTON STYLING ---------------------------------------------- */

button {
    padding: 7px 15px;
    margin: 8px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

#adminLoginBtn {
    background-color: #0056b3;
    color: white;
}

#saveChangesBtn {
    background-color: #007bff;
    color: white;
}

.admin-mode-btn {
    background-color: #b30000 !important;
    color: white !important;
}

/* ADD PLAYER BUTTON -------------------------------------------- */

#addPlayerBtn {
    background-color: #444;
    color: white;
    display: none; /* only shown in admin mode */
}

.admin-mode #addPlayerBtn {
    display: inline-block;
}

/* TABLE CONTAINER --------------------------------------------- */

.table-wrapper {
    padding: 20px;
}

/* TABLE FORMATTING --------------------------------------------- */

table {
    width: 100%;
    border-collapse: collapse;
    background-color: #1e1e1e;
}

thead {
    background-color: #003f91;  /* Blue header row */
}

thead th {
    padding: 10px;
    font-size: 14px;
    color: white;
    cursor: pointer;  /* Click to sort */
    border-bottom: 2px solid #222;
    text-align: center;
}

/* Admin Mode Header Color */
.admin-mode thead {
    background-color: #8B0000 !important;
}

tbody tr {
    border-bottom: 1px solid #333;
}

tbody tr:hover {
    background-color: #2a2a2a;
}

tbody td {
    padding: 10px;
    text-align: center !important;  /* CENTER ALL DATA */
}

/* Editable inputs --------------------------------------------- */

.editable-cell input {
    width: 80px;
    text-align: center !important;
    padding: 4px;
    border-radius: 4px;
    border: 1px solid #666;
    background-color: #2d2d2d;
    color: white;
}

/* Player name cells */
.player-name-cell input {
    width: 150px;
    text-align: center !important;
}

/* ACTION BUTTONS ---------------------------------------------- */

.delete-btn {
    background-color: #b30000;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.delete-btn:hover {
    background-color: #ff0000;
}

/* ADD PLAYER POPUP -------------------------------------------- */

#addPlayerPopup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #1f1f1f;
    padding: 25px;
    border-radius: 8px;
    border: 2px solid #444;
    display: none;
    z-index: 9999;
}

#addPlayerPopup select,
#addPlayerPopup input {
    width: 90%;
    padding: 6px;
    margin: 8px 0;
    border-radius: 4px;
    border: 1px solid #555;
    background-color: #2c2c2c;
    color: white;
}

#confirmAddBtn {
    background-color: #007bff;
    color: white;
}

#closeAddBtn {
    background-color: #555;
    color: white;
}

.eightball-logo {
    width: 90px;         /* Same as the 9-ball size */
    height: 90px;        /* Must match width for perfect circle */
    border-radius: 50%;  /* Make it round */
    object-fit: cover;   /* Prevent distortion */
    margin-right: 15px;  /* Space between logo and text */
}
/* Freeze player column titles while scrolling (desktop and mobile). */
#playerTable thead th {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #003f91;
}

/* Preserve the existing red header in admin mode. */
.admin-mode #playerTable thead th {
    background-color: #8B0000;
}
