/* ==========================================================================
   Base Styles (Desktop-first approach - these styles apply by default)
   ========================================================================== */

/* General Body and Page Defaults */
body {
    margin: 0;
    background: #e6e6e6;
    font-family: Arial, sans-serif;
    color: #333;
}

/* ==========================================================================
   TOP TEAM BADGES BAR
   ========================================================================== */
.top-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background-color: black;
}

.top-bar a {
    text-decoration: none;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.top-bar a img {
    display: block;
    height: 50px;
    object-fit: contain;
}

/* ==========================================================================
   HEADER SECTION
   ========================================================================== */
.header-container {
    background-image: url('/static/icons/fc-26-logo.png'); /* Pattern on the main header */
    background-repeat: repeat;
    background-size: 40px;
    display: flex;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 5px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    background-color: transparent; /* Default desktop is transparent to show pattern */
}

.header-logo {
    height: 100px;
    width: auto;
    margin-right: 20px;
    flex-shrink: 0;
}

.header-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1; /* Allows text to take available space */
    min-width: 0; /* Prevents overflow with long words */
}

.header-text h1 {
    font-family: 'Verdana', sans-serif;
    font-size: 40px;
    color: #333;
    margin: 0;
    text-transform: uppercase;
    line-height: 1.1;
    word-break: break-word; /* Allows long words to break */
}

.header-text p {
    font-family: 'Verdana', sans-serif;
    font-size: 1.1em;
    color: #555;
    margin: 5px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    word-break: break-word;
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.nav {
    background: #2c6d8c;
    padding: 10px;
    text-align: center;
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Allows nav items to wrap on smaller screens */
}

.nav a {
    color: white;
    margin: 0 15px; /* Original desktop margin */
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    flex-shrink: 0; /* Prevents nav items from shrinking */
    white-space: nowrap; /* Keeps text on one line */
    padding: 5px 12px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}
.nav a:hover {
    background-color: #3e8eb0;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.content {
    max-width: 900px;
    margin: 20px auto;
    background: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Section Title (Used on Stats, Rounds pages) */
.round-title {
    font-size: 22px;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

/* ==========================================================================
   Image Size Classes (for consistent image sizing across templates)
   ========================================================================== */
.player-icon { /* For smaller player representations, e.g., suspended players list */
    height: 50px; /* Default desktop size for player icons */
    object-fit: cover;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 8px;
}
.team-player-image { /* For player photos in the roster table */
    height: 45px; /* Slightly smaller than general player-icon for roster */
    width: 45px; /* Make it square */
    object-fit: cover;
    border-radius: 50%; /* Make it circular */
    vertical-align: middle;
    margin-right: 10px;
    flex-shrink: 0; /* Important for flex items */
}
.team-badge-small {
    height: 45px; /* Default desktop size for small team badges */
    width: auto; /* Allow width to scale with height */
    max-width: 100%; /* Important: Prevent overflow */
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0; /* Prevents badges from shrinking in flex containers */
    display:flex; 
    justify-content:center; 
    align-items:center; 
    text-decoration:none; 
    color:inherit;
}
.card-icon {
    display: inline-block;
    height: 18px; /* Default desktop size for card icons */
    width: auto;
    max-width: 100%; /* Important: Prevent overflow */
    vertical-align: middle;
    margin-right: 3px;
    flex-shrink: 0; /* Prevents icons from shrinking in flex containers */
}
.event-icon { /* General event icon, e.g., football */
    height: 20px;
    width: auto;
    max-width: 100%; /* Important: Prevent overflow */
    vertical-align: middle;
    margin-right: 5px;
    flex-shrink: 0; /* Prevents icons from shrinking in flex containers */
}

/* ==========================================================================
   Match Row Styling (Used on home, team_details, round_details, etc.)
   ========================================================================== */
.match {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #243447;
    padding: 16px;
    margin-bottom: 8px;
    border-radius: 6px;
}

.match .team {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.team {
    width: 35%;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.team.right {
    justify-content: flex-end;
}

.team img { /* Match page team logos */
    height: 45px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.team-name {
    font-size: 16px;
    font-weight: 700;
    color: orange;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.score {
    width: 30%;
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    color: orange;
    flex-shrink: 0;
}

.status {
    font-size: 12px;
    margin-top: 4px;
    color: #bbb;
}

.score-link {
    color: inherit;
    text-decoration: none;
}


/* ==========================================================================
   Table Base Styling (Applied to all tables with specific classes)
   ========================================================================== */
/* Wrapper for tables that need horizontal scrolling */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* For iOS momentum scrolling */
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: orange #2c6d8c; /* For Firefox */
}
.table-responsive::-webkit-scrollbar { height: 8px; }
.table-responsive::-webkit-scrollbar-thumb { background: orange; border-radius: 4px; }
.table-responsive::-webkit-scrollbar-track { background: #2c6d8c; }


/* Styles for all table elements inside various table types */
.general-table,
.roster-table,
.suspended-players-table,
.league-table,
.stats-table {
    width: 100%; /* Make the table fill its container on desktop */
    border-collapse: collapse;
    background: #1f2f3f;
    color: white;
    margin-top: 20px;
    display: table;
}

.general-table th, .roster-table th, .stats-table th, .suspended-players-table th,
.general-table td, .roster-table td, .stats-table td, .suspended-players-table td {
    padding: 10px;
    border-top: 1px solid #2e3e4e;
    text-align: center;
    font-size: 15px;
    border-right: 1px solid #2e3e4e;
}

/* Apply nowrap where appropriate for non-text columns */
.roster-table th, .roster-table td { /* Default for roster */
    white-space: nowrap;
}


.general-table th, .roster-table th, .league-table th, .stats-table th, .suspended-players-table th {
    background: #2c6d8c;
    font-size: 12px;
    text-transform: uppercase;
    position: sticky; /* Makes headers stick during scroll */
    top: 0;
    left: 0;
    z-index: 1; /* Ensures header is above table content */
}

.general-table td:last-child, .general-table th:last-child,
.roster-table td:last-child, .roster-table th:last-child,
.league-table td:last-child, .league-table th:last-child,
.stats-table td:last-child, .stats-table th:last-child {
    border-right: none;
}

.general-table tr:nth-child(even), .roster-table tr:nth-child(even),
.league-table tr:nth-child(even), .stats-table tr:nth-child(even) {
    background: #24394d;
}

.general-table tr:hover, .roster-table tr:hover,
.league-table tr:hover, .stats-table tr:hover {
    background: #2f4b63;
}

/* Specific table cell styling */
td.team-cell { text-align: right; padding-left: 15px; }
td.stat-cell { text-align: center; width: 100px; vertical-align: middle;}
td.num-cell { text-align: center; width: 20px; }


/* --- Roster Table (team_details.html) --- */
.roster-table {
    table-layout: fixed; /* Ensures columns take defined widths */
}
.roster-table th a { color: inherit; text-decoration: none; display: inline-block; white-space: nowrap; }
.roster-table th a:hover { color: orange; }

/* Default (Desktop) visibility for full/abbreviated text */
.roster-table th .full-text {
    display: inline; /* Show full text by default */
}
.roster-table th .abbr-text {
    display: none; /* Hide abbreviated text by default */
}


/* Specific column widths for roster table */
.roster-table th:nth-child(1), .roster-table td.num-cell {
    width: 5%;
    min-width: 30px; /* Ensure a minimum width */
}
.roster-table th:nth-child(2), .roster-table td.name-cell {
    width: 25%;
    min-width: 150px; /* Give player name more space by default */
}
.roster-table th.roster-pos-col, .roster-table td.pos-cell { /* Used class for 'Position(s)' */
    width: 18%;
    min-width: 80px;
    white-space: normal; /* Allow positions to wrap */
}
.roster-table th:nth-child(4), .roster-table td:nth-child(4), /* Goals */
.roster-table th:nth-child(5), .roster-table td:nth-child(5), /* Yellow Cards */
.roster-table th:nth-child(6), .roster-table td:nth-child(6), /* Red Cards */
.roster-table th.roster-rating-col, .roster-table td:nth-child(7), /* Rating */
.roster-table th.roster-potential-col, .roster-table td:nth-child(8) { /* Potential */
    width: 8%; /* Adjust for remaining space */
    min-width: 45px; /* Smallest possible icon column */
    text-align: center;
}

/* Roster Table: td.name-cell */
.roster-table td.name-cell {
    text-align: left;
    padding-left: 5px; /* Adjust padding for better alignment */
    white-space: normal; /* Allow text wrapping */
}

/* Specific styling for the link inside name-cell */
.roster-table td.name-cell a {
    display: flex; /* Use flexbox for image and name */
    align-items: center; /* Vertically center image and text */
    text-decoration: none;
    color: inherit;
    width: 100%; /* Allow the link to take full width of its parent */
    box-sizing: border-box; /* Include padding/border in width calculation */
}

/* Ensure player name text within the link can truncate if necessary */
.roster-table td.name-cell a span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block; /* Make it a block to properly truncate */
    flex-grow: 1; /* Allow the name to grow and take available space */
}


/* --- Suspended Players Table (home.html) --- */
.suspended-players-table {
    width: 100%;
    margin-top: 20px;
    color: white;
}
.suspended-players-table th, .suspended-players-table td {
    padding: 10px;
    border-top: 1px solid #2e3e4e;
    text-align: left;
    font-size: 15px;
    border-right: 1px solid #2e3e4e;
    white-space: nowrap; /* Default desktop behavior */
}


/* --- League Table (table.html) --- */
.league-table {
    width: 100%;
    table-layout: fixed; /* This is the key! */
    border-collapse: collapse;
    margin-bottom: 2rem;
}

/* Base styles for ALL cells in this specific table */
.league-table th,
.league-table td {
    padding: 10px;
    border-top: 1px solid #2e3e4e;
    border-right: 1px solid #2e3e4e;
    text-align: center; /* Set the default alignment for most columns */
    font-size: 15px;
}

/* Remove the right border on the very last column */
.league-table th:last-child,
.league-table td:last-child {
    border-right: none;
}


/* --- Specific Column Widths & Overrides --- */

/* Col 1: Pos */
.league-table th:nth-child(1),
.league-table td:nth-child(1) {
    width: 5%;
}

/* Col 2: Team - This gets the most width */
.league-table th:nth-child(2),
.league-table td:nth-child(2) {
    width: 35%;
    text-align: left; /* IMPORTANT: Override the default center alignment */
}

/* The rest of the numeric columns */
.league-table th:nth-child(n+3),
.league-table td:nth-child(n+3) {
    width: 5%;
}

/* Special width for Points column to make it slightly larger */
.league-table th:nth-child(10),
.league-table td:nth-child(10) {
    width: 8%;
    font-weight: bold;
}


/* --- Stats Table (stats.html) --- */
.stats-table {
    table-layout: auto;
}


/* ==========================================================================
   Pagination Styling (Used on all pages with pagination)
   ========================================================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #243447;
    padding: 10px 15px;
    margin-top: 15px;
    border-radius: 8px;
    flex-wrap: wrap; /* Allows items to wrap */
}

.page-left, .page-center, .page-right {
    display: flex;
    gap: 6px;
    flex-basis: auto; /* Allow content to dictate size */
    margin-bottom: 5px; /* Space between rows on wrap */
}

.page-center {
    justify-content: center;
    flex: 1; /* Takes available space */
    min-width: 100%; /* Forces it to a new line on small screens */
    order: 3; /* Order when wrapped */
}
.page-center h3{
   color:orange
}
.page-left {
    justify-content: flex-start;
    min-width: auto;
    order: 1;
}
.page-right {
    justify-content: flex-end;
    min-width: auto;
    order: 2;
}

.pagination a {
    padding: 5px 10px;
    background: #1c2633;
    color: orange;
    text-decoration: none;
    text-align: center;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 15px;
    transition: 0.2s;
    display: inline-flex; /* For better vertical alignment of content */
    flex-shrink: 0; /* Prevents button from shrinking */
}

.pagination a:hover {
    background: orange;
    color: #000;
}

.pagination .active {
    padding: 6px 10px;
    background: orange;
    color: #000;
    border-radius: 4px;
    font-weight: bold;
}


/* ==========================================================================
   Cards (Next Round / Suspended Players - home.html)
   ========================================================================== */
.next-round, .suspended-players-section {
    background: #243447;
    padding: 20px;
    border-radius: 8px;
    max-width: 900px;
    margin: 20px auto;
    text-align: center;
    color: white;
}

.round-name {
    font-size: 22px;
    font-weight: bold;
    color: #fff;
}

.round-date {
    color: orange;
    margin: 5px 0;
}

.round-host {
    font-size: 13px;
    color: #ccc;
    padding: 20px
}

.round-host a img {
    vertical-align: middle;
    margin-right: 5px;
    object-fit: contain;
}

/* DIGITAL COUNTDOWN (home.html) */
.countdown {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.time-group {
    text-align: center;
    color: white;
    flex: 1; /* Allow groups to share space */
    max-width: 80px;
}
.time-group small {
    font-size: 12px;
    margin-top: 5px;
}

.flip-group {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.flip-card {
    background: #857939; /* Gold-ish color for flip cards */
    color: white;
    font-size: 28px;
    font-weight: bold;
    width: 40px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    position: relative;
    box-shadow: 0 4px 0 rgba(0,0,0,0.4);
    overflow: hidden; /* Ensure content stays within borders */
}

.flip-card::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.2);
    transform: translateY(-50%); /* Centering the line */
}


/* ==========================================================================
   Team Details Page Specific Styling (team_details.html)
   ========================================================================== */
.team-detail-header {
    margin-bottom:20px;
    display:flex;
    align-items: center; /* Added for better vertical alignment */
    gap: 20px; /* Space between logo and info stack */
    max-width: 900px; /* Constrain width to match .content */
    margin-left: auto;
    margin-right: auto;
    padding: 5px 20px; /* Match header-container padding */
}
.team-detail-header > img { /* Target the main team logo */
    max-height: 150px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}
.team-info-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1; /* Allows info stack to take remaining space */
    min-width: 0; /* Important for flex items with text overflow */
}
.info-box {
    background: #1f2f3f;
    padding: 10px;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    /* margin-top: 5px; Removed, gap on parent handles it */
}
.info-box.manager { margin-top: 0; } /* Keep this to remove extra margin */
.info-box.quote {
    font-size: 13px;
    font-style: italic;
    font-weight: normal;
    font-family: 'Verdana';
}

.roster-block-wrapper {
    background: #243447;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.roster-block-wrapper h4 { /* Target the h4 inside this block */
    color: orange;
}

.next-fixtures-section h3 {
    text-align: center;
    margin-top: 25px; /* Add some top margin for separation */
    margin-bottom: 15px;
    color: #333; /* Default text color */
}
.next-fixtures-section p { /* Style the 'No upcoming fixtures' text */
    text-align:center;
    color:#777;
    margin-top: 20px;
}


/* ==========================================================================
   TEAMS PAGE SPECIFIC STYLING (teams.html) - NEW
   ========================================================================== */
.team-grid-container {
    display: block; /* Override grid behavior */
    columns: 3; /* Try to create 4 columns initially */
    column-gap: 20px; /* Space between columns */

    padding: 20px 0;
    max-width: 900px;
    margin: 20px auto;
    background: transparent;
}

.team-card-link {
    break-inside: avoid-column; /* Prevent cards from breaking across columns */
    display: inline-block; /* Essential for break-inside to work with columns */
    width: 100%; /* Make each card-link take the full width of its column */
    margin-bottom: 20px; /* Space between cards in the same column */

    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.team-card-link:hover {
    transform: translateY(-5px); /* Lift effect on hover */
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.team-card {
    background: #243447; /* Dark background for the card */
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%; /* Ensures cards in a row have same height */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); /* Shadow for each individual card */
}

.team-card img {
    width: 100px; /* Fixed size for team logos in grid */
    height: 100px;
    object-fit: contain;
    margin-bottom: 10px;
}

.team-card-name {
    font-size: 18px;
    font-weight: bold;
    color: orange; /* Your accent color */
    margin: 0;
    white-space: nowrap; /* Prevent name from breaking */
    overflow: hidden;
    text-overflow: ellipsis; /* Add ellipsis if name is too long */
}


/* ==========================================================================
   Login Page Styling
   ========================================================================== */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.login-card {
    width: 420px;
    background: #243447;
    border-radius: 8px;
    padding: 25px;
    border: 1px solid #1b2633;
}

.login-title {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: orange;
    margin-bottom: 20px;
}

.login-error {
    background: #3a1f1f;
    border: 1px solid #a33;
    color: #ffb3b3;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
}

.login-form .form-group {
    margin-bottom: 15px;
}

.login-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    text-transform: uppercase;
    color: #bbb;
}

.login-form input {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #1c2a3a;
    background: #1f2f3f;
    color: white;
    font-size: 14px;
    outline: none;
    box-sizing: border-box; /* Include padding/border in width */
}

.login-form input:focus {
    border-color: orange;
}

.login-button {
    width: 100%;
    padding: 10px;
    background: #1c2633;
    border: 1px solid #2c6d8c;
    color: orange;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    box-sizing: border-box; /* Include padding/border in width */
}

.login-button:hover {
    background: orange;
    color: black;
}


/* ==========================================================================
   Edit Score Page Specific Styling (edit_score.html)
   ========================================================================== */

/* New wrapper for the two team edit sections */
.edit-match-teams-wrapper {
    display: flex; /* Desktop: side-by-side */
    justify-content: space-around; /* Distribute space between them */
    gap: 20px; /* Space between the two team blocks */
    margin: 10px 0;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.edit-match-page .team {
    /* Existing .team styles are fine, but adjust width for the new flex context */
    width: 40%; /* Each team takes roughly half the wrapper width */
    max-width: 400px; /* Prevent them from becoming too wide on very large screens */
    display: inline-block; /* Keeping inline-block for consistency with old style, though flex context makes it less critical */
    vertical-align: top;
    text-align: center;
    background: #243447; /* Match overall dark theme */
    color: white; /* Text color for the new background */
    padding: 20px; /* Increased padding for better appearance */
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); /* Add subtle shadow */
}

/* Override the default .match padding to avoid double padding if the .match class is reused */
.edit-match-page .match {
    padding: 0; /* Remove padding from .match, the wrapper handles it */
    background: none; /* No background here, it's on .edit-match-page .team */
    margin-bottom: 0; /* No margin bottom */
    border-radius: 0; /* No border radius here */
    flex-direction: column; /* Match page now only contains one team, stack its elements */
    align-items: center;
}

/* Adjust image size for edit page */
.edit-match-page .team > img { /* Target the team logo directly inside the team block */
    height: 100px; /* Larger logo for the edit page */
    width: auto;
    object-fit: contain;
    margin-bottom: 15px;
}

.edit-match-page .team-name {
    font-size: 20px;
    margin-bottom: 20px;
    color: orange; /* Maintain accent color */
}

.edit-match-page h4 {
    color: white;
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 1px solid #3a4b5d; /* Subtle separator */
    padding-bottom: 5px;
    font-size: 1.1em;
}

.edit-match-page .event-row {
    display: flex;
    justify-content: center; /* Center items within the row */
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.edit-match-page .event-row input[type="number"] {
    width: 50px; /* Slightly wider for better touch */
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #1c2a3a;
    background: white;
    color: #1f2f3f;
}

.edit-match-page select[name*="player"],
.edit-match-page select[name*="card_type"] {
    height: 38px; /* Taller for easier selection */
    width: 150px; /* Wider for names */
    padding: 0 8px; /* Add some internal padding */
    border-radius: 4px;
    border: 1px solid #1c2a3a;
    background: white;
    color: black;
    font-size: 14px;
}

.edit-match-page select option {
    background-color: #1f2f3f; /* Dark background for options */
    color: white;
}

.edit-match-page .add-btn {
    margin: 15px 0;
    padding: 8px 15px;
    background: #2c6d8c; /* Match nav bar color */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}
.edit-match-page .add-btn:hover {
    background-color: #3e8eb0;
}

.form-errors {
    color: #ffb3b3; /* Lighter red for visibility */
    background: #3a1f1f;
    border-radius: 4px;
    padding: 5px 10px;
    margin-top: 5px;
    font-size: 0.8em;
    width: fit-content; /* Only take content width */
    margin-left: auto;
    margin-right: auto;
}
.error-message {
    display: block;
}

.save-btn, .cancel-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    border: none;
}

.save-btn {
    background: orange;
    color: black;
}
.save-btn:hover {
    background: #ffcc00;
}

.cancel-btn {
    background: #3a4b5d;
    color: white;
}
.cancel-btn:hover {
    background: #556a7d;
}

.edit-match-page .score-box {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
}

/* The actual score input */
.edit-match-page .score-input {
    width: 80px;
    height: 60px;
    text-align: center;

    font-size: 2rem;
    font-weight: bold;

    border-radius: 12px;
    border: 2px solid #1c2a3a;

    background: White;
    color: #1c2a3a;

    outline: none;
}

/* Focus effect */
.edit-match-page .score-input:focus {
    border-color: #4da3ff;
    box-shadow: 0 0 8px rgba(77, 163, 255, 0.5);
}


/* ==========================================================================
   Match Details Page Specific Styling (match_details.html)
   ========================================================================== */
.event-separator {
    height: 12px;
}

.match-events-detail-section {
    background: #243447;
    color: white;
    padding: 10px;
    padding-top: 5px;
    padding-bottom: 0px;
    margin-top: 20px;
    border-radius: 8px;
}

.match-events-columns {
    display: flex;
    justify-content: space-between;
    background: #243447;
    padding: 16px;
    margin-bottom: 8px;
    border-radius: 6px;
    flex-wrap: wrap; /* Allow columns to wrap on smaller screens */
}

.events-column {
    width: 45%;
}

.event-entry {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pushes player name left, icons right */
    gap: 10px;
    margin-bottom: 8px;
    font-size: 16px;
}

.event-entry .player-name {
    font-weight: bold;
    color:orange;
    flex-grow: 1; /* Allows player name to take space */
    text-align: left; /* Align player name left within its column */
}


.goal-icons {
    display: flex;
    gap: 3px;
    align-items: center;
    flex-shrink: 0; /* Prevents icons from shrinking */
}

.card-type-section {
    margin-bottom: 20px;
}

/* ==========================================================================
   Statistics Page Styling (stats.html)
   ========================================================================== */
.stats-navigation {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    background: #1f2f3f;
    padding: 10px;
    border-radius: 8px;
    flex-wrap: wrap; /* Allow nav items to wrap */
}

.stats-nav-link {
    display: flex;
    align-items: center;
    padding: 8px 8px;
    background: #2c6d8c;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0; /* Prevents links from shrinking */
}

.stats-nav-link:hover {
    background: #3a8dbd;
    color: orange;
}

.stats-nav-link.active {
    background: orange;
    color: black;
    cursor: default;
}

.stats-nav-link.active:hover {
    background: orange;
    color: black;
}

.nav-icon {
    height: 20px;
    width: auto;
}

.stats-header-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap; /* allows stacking on small screens */
}

.stats-section {
    flex: 1;
    min-width: 250px;
}

/* ==========================================================================
   Round Selector Pagination Styling (New: For the bottom round links)
   ========================================================================== */
.round-selector-pagination {
    /* Mimics the general .pagination container styling */
    max-width: 900px;
    margin: 20px auto; /* Same spacing as main content and pagination */
    background: #243447;
    padding: 10px 15px;
    border-radius: 8px;

    /* Flex properties to arrange title and round links */
    display: flex;
    align-items: center;
    justify-content: center; /* Center the entire content block */
    flex-wrap: wrap; /* Allow content to wrap on smaller screens */
    gap: 10px; /* Space between items (e.g., title and first round link) */

    /* Specific styling for the items inside */
    color: white; /* Default text color */
}

.round-selector-pagination h3 {
    color: orange;
    margin: 0; /* Override default h3 margin */
    white-space: nowrap; /* Keep the title on one line */
    font-size: 18px; /* Based on image reference */
    font-weight: bold;
}

/* Style for individual round links within the selector */
.round-selector-pagination a {
    padding: 5px 10px;
    background: #1c2633;
    color: orange;
    text-decoration: none;
    text-align: center;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    transition: background 0.2s;
    white-space: nowrap; /* Keep "Round X" on one line */
    flex-shrink: 0; /* Prevent from shrinking */
}

.round-selector-pagination a:hover {
    background: orange;
    color: #000;
}

/* Style for the currently active round link */
.round-selector-pagination a.active-round {
    background: orange;
    color: #000;
}