.fa {
    font-family: 'FontAwesome' !important;
}

/* ==========================================================================
   1. VARIABLES & ROOT
   ========================================================================== */
:root {
    --c-white: #ffffff;
    --c-dark-grey: #2c3e50;
    --c-light-grey: #f0f0f0;
    --c-text-grey: #555;
    --c-south: #091C3A;
}

/* ==========================================================================
   2. GENERATOR TOOL UI (Admin page styles)
   ========================================================================== */

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.preview-box,
#txt_raw_html {
    width: 100% !important;
    max-width: 100%;
    display: block;
    box-sizing: border-box;
}

#txt_raw_html {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 12px;
    resize: vertical;
}

/* ==========================================================================
   3. MATCH REPORT - BASE & HERO
   ========================================================================== */
.match {
    margin-bottom: 0;
    background: var(--c-light-grey);
    font-family: sans-serif;
}

.match_hero_main {
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 10px;
    background-color: var(--c-white);
}

.match_hero_details {
    padding: 1.5rem;
    text-align: center;
    background-color: var(--c-light-grey);
    margin-bottom: 1.5rem;
    border-radius: 10px;
}

.match_hero_title,
.match_hero_game_date {
    color: var(--c-text-grey);
    font-size: 16pt;
    font-weight: bold;
}

.match_hero_title {
    text-transform: uppercase;
}

.match_hero_teams {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
}

.match_hero_team {
    height: 12rem;
    color: var(--c-white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    text-transform: uppercase;
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
    box-sizing: border-box;
    /* Ensures borders don't break layout */
}

.match_hero_team--away {
    flex-direction: row-reverse;
    border-radius: 0 15px 15px 0;
    /* Cleaner radius shorthand */
}

.match_hero_team_part {
    display: flex;
    align-items: center;
    justify-content: center;
}

.match_hero_team_part--name {
    display: none;
}

.match_hero_team_name {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    max-width: 12rem;
}

.match_hero_team_logo {
    width: 12rem;
    max-height: 100%;
    object-fit: contain;
}

.match_hero_team_score {
    text-align: center;
    width: 7rem;
}

.match_hero_team_score_total {
    font-size: 8rem;
    line-height: 1;
    font-weight: bold;
}

.match_hero_team_score_breakdown {
    text-transform: uppercase;
    font-size: 1.5rem;
    font-weight: bold;
}

.match_hero_vs {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--c-light-grey);
    color: var(--c-dark-grey);
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 1.2rem;
    z-index: 2;
}

.match_hero_time {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--c-light-grey);
    color: var(--c-dark-grey);
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 1.2rem;
    z-index: 2;
}

.match_day_parking {
    /* background-color: var(--c-light-grey);
    border: 1px solid #e0e0e0; */
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    width: 100%;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ==========================================================================
   4. SCORE FLOW (Table Section)
   ========================================================================== */
.match_scoreDetail {
    background: var(--c-white);
    padding: 20px 0;
    /* border-bottom: 1px solid #ddd; */
    display: flex;
    justify-content: center;
}

.match_scoreDetail .table-responsive {
    border: none;
    width: auto;
}

.match_scoreDetail table td,
.match_scoreDetail table th {
    padding: 10px 25px !important;
    white-space: nowrap;
    font-size: 2.0rem;
}

/* ==========================================================================
   5. PLAYER STATS (The Grey Cards)
   ========================================================================== */
.match_scoreOverview {
    padding: 2.5rem 1.4rem;
    /* background: var(--c-white);  */
}

.centered-player-list-column {
    display: flex;
    justify-content: center;
    padding: 0 15px;
}

.player-text-list {
    background-color: var(--c-light-grey);
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    width: 100%;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.player-list-title {
    font-size: 1.4rem;
    text-transform: uppercase;
    font-weight: bold;
    color: var(--c-south);
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1rem;
    margin-bottom: 1.2rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.player-list-text {
    font-size: 1.4rem;
    line-height: 1.6;
    color: var(--c-dark-grey);
}

/* Player with Image Entry */
.player-entry {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
    justify-content: center;
}

.player-img-container {
    width: 80px;
    height: 80px;
    margin-right: 10px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 50%;
}

.player-name,
.player-stat {
    font-size: 1.8rem;
    font-weight: bold;
}

.player-stat {
    color: var(--c-text-grey);
    margin-left: 5px;
}

/* ==========================================================================
   6. RESPONSIVE QUERIES
   ========================================================================== */

/* Very Small Devices */
@media (max-width: 480px) {
    .match_hero_teams {
        flex-direction: row;
    }

    .match_hero_team {
        width: 50%;
        height: 9rem;
        padding: 0.5rem;
        justify-content: center;
    }

    .match_hero_vs {
        font-size: 1rem;
        padding: 0.3rem 0.6rem;
    }

    .match_hero_time {
        font-size: 1rem;
        padding: 0.3rem 0.6rem;
    }

    .match_hero_title {
        font-size: 1.6rem;
        line-height: 1.3;
    }

    .match_hero_team_logo {
        width: 6rem;
    }

    .match_hero_team_score_total {
        font-size: 4rem;
    }
}

/* Tablet/Mobile Table Scaling */
@media (max-width: 767px) {

    .match_scoreDetail table td,
    .match_scoreDetail table th {
        padding: 8px 10px !important;
        font-size: 12px;
    }
}

/* Desktop Expansion */
@media (min-width: 768px) {
    .match_hero_teams {
        flex-direction: row;
    }

    .match_hero_team {
        width: 50%;
        height: 16rem;
        padding: 3rem;
    }
}

@media (min-width: 992px) {
    .match_hero_team {
        height: 20rem;
    }

    .match_hero_team_part {
        width: 33.333%;
    }

    .match_hero_team_part--name {
        display: flex;
    }

    .match_scoreOverview {
        padding: 2rem 3rem;
    }
}

/* ==========================================================================
   TEAM SELECTION STYLES
   ========================================================================== */

/* Player Roster Styles */
.roster-container {
    max-height: 1200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #f9f9f9;
}

.roster-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 5px 0;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    cursor: move;
    user-select: none;
    transition: all 0.2s ease;
}

.roster-item:hover {
    background-color: #f0f7ff;
    border-color: #091C3A;
    box-shadow: 0 2px 4px rgba(9, 28, 58, 0.2);
}

.roster-item.selected-in-squad {
    background-color: #e8f5e9;
    border-color: #28a745;
}

.roster-item-tick {
    color: #28a745;
    font-size: 1.2em;
}

.roster-item.dragging {
    opacity: 0.5;
    background-color: #e8e8e8;
}

.roster-item-text {
    line-height: 1.4;
}

.roster-item-number {
    font-weight: bold;
    color: #091C3A;
}

.roster-item-name {
    font-size: 0.9em;
    color: #555;
}

/* Team Selection Grid */
.team-selection-grid {
    display: grid;
    grid-template-columns: auto repeat(3, 1fr);
    gap: 12px;
    margin-top: 10px;
    padding: 5px;
    background-color: #f0f0f0;
    border-radius: 4px;
    align-items: center;
}

.grid-row-label {
    font-weight: bold;
    color: #091C3A;
    font-size: 1.2em;
    text-align: right;
    padding-right: 15px;
}

.grid-divider {
    grid-column: 1 / -1;
    height: 40px;
    background-color: transparent;
}

.grid-position {
    background-color: white;
    border: 2px dashed #ccc;
    border-radius: 6px;
    padding: 8px;
    max-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: default;
    transition: all 0.2s ease;
    position: relative;
}

.grid-position:hover {
    border-color: #091C3A;
    background-color: #f5f5f5;
}

.grid-position.drag-over {
    background-color: #d9edf7;
    border-color: #091C3A;
    box-shadow: inset 0 0 6px rgba(9, 28, 58, 0.2);
}

.grid-position-label {
    font-size: 0.85em;
    color: #999;
    font-weight: bold;
    margin-bottom: 8px;
}

.grid-position-empty {
    color: #ccc;
    font-size: 2.5em;
    line-height: 1;
}

.selected-player-card {
    width: 100%;
    background-color: #fff;
    border-radius: 4px;
    padding: 2px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.selected-player-card.draggable {
    cursor: grab;
}

.selected-player-card.draggable:active {
    cursor: grabbing;
}

.selected-player-number {
    font-weight: bold;
    color: #091C3A;
    font-size: 1.1em;
    line-height: 1.4;
}

.selected-player-name {
    font-size: 0.9em;
    color: #555;
    margin-top: 2px;
}

.selected-player-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 0.8em;
    cursor: pointer;
    display: none;
    line-height: 1;
}

.grid-position:hover .selected-player-remove {
    display: block;
}

.selected-player-remove:hover {
    background-color: #c82333;
}

/* Position Labels */
.grid-row-title {
    font-weight: bold;
    color: #091C3A;
    margin: 15px 0 10px 0;
    text-align: left;
    font-size: 1.1em;
}

/* Copy to Clipboard */
.copy-html-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.copy-html-section textarea {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

.copy-html-section .copy_msg {
    color: #28a745;
    font-weight: bold;
    margin-left: 10px;
}

/* Previous Game Selection */
.copy-from-previous {
    margin-top: 15px;
    padding: 12px;
    background-color: #e8f4f8;
    border-left: 4px solid #091C3A;
    border-radius: 2px;
}

.copy-from-previous select {
    min-width: 200px;
}

/* Buttons */
.btn-team-action {
    margin: 5px 5px 5px 0;
}

.btn-preview {
    background-color: #091C3A;
    border-color: #091C3A;
    color: white;
}

.btn-preview:hover {
    background-color: #05132a;
    border-color: #05132a;
}

.btn-save {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.btn-save:hover {
    background-color: #218838;
    border-color: #218838;
}

.btn-clear {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-clear:hover {
    background-color: #c82333;
    border-color: #c82333;
}

/* Responsive Grid */
@media (max-width: 768px) {
    .team-selection-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .grid-position {
        min-height: 100px;
    }
}

@media (max-width: 480px) {
    .team-selection-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Custom Card Container --- */
.player-card-custom {
    background: #fff;
    border-radius: 12px;
    /* Rounded card corners */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* Soft shadow */
    overflow: hidden;
    /* Ensures images don't bleed outside rounded corners */
    margin-bottom: 30px;
    text-align: center;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* --- Image Section & Overlays --- */
.img-frame {
    position: relative;
    width: 100%;
    /* 🚨 NEW: Background Image Setup */
    background-image: url('https://assets.cdn.thewebconsole.com/S3WEB6803/images/25-Panther-Head-60.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    /* Keep rounded corners clean */
}

/* --- Add this new rule to your style block --- */
.img-frame .row {
    display: flex;
    /* 🚨 FIX: Forces col-xs-3 and col-xs-9 to match height */
    /* You may need to remove default BS3 row margins for clean edges: */
    margin-left: 0;
    margin-right: 0;
}

/* --- Modify the existing .jumper-number-container rule --- */
.jumper-number-container {
    padding: 15px 0 15px 15px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* This can now push the number to the guaranteed bottom */
    /* REMOVED: height: 100%; - The flex parent handles stretching now */
}

/* The large number */
.jumper-number-txt {
    font-size: 70px;
    line-height: 1;
    font-weight: 800;
    color: #001540;
    z-index: 2;
    text-align: left;
    margin-top: auto;
}

/* The player image container */
.player-image-container {
    padding-left: 0;
    /* Remove padding between number column and image column */
}

.player-photo {
    width: 100%;
    height: auto;
    display: block;
}

/* The white fade at the bottom (adjust to fit new inner structure) */
.bottom-fade {
    position: absolute;
    bottom: 0;
    left: 25%;
    /* Start the fade at the edge of the number column */
    width: 75%;
    /* Cover only the image column */
    height: 10%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 90%);
    z-index: 1;
}

/* --- Typography Section --- */
.card-details {
    padding: 10px 20px 25px 20px;
    color: #001540;
    /* Dark blue base color */
}

.firstname-txt {
    font-size: 18px;
    margin-bottom: 0;
    font-weight: 400;
}

.surname-txt {
    font-size: 28px;
    font-weight: 800;
    margin-top: 0;
    text-transform: capitalize;
}

/* Custom thicker, shorter divider */
.custom-divider {
    border-top: 3px solid #001540;
    width: 40%;
    /* Short width */
    margin: 15px auto;
    /* Centered margins */
}

.details-txt {
    font-size: 16px;
    margin-bottom: 5px;
    color: #334d75;
    /* Slightly lighter blue for details */
}

/* --- Sponsor Section --- */
.sponsor-box {
    background-color: #ffffff;
    /* border-radius: 15px;
            padding: 15px;
            margin-top: 15px; */
    display: flex;
    justify-content: center;
    align-items: center;
}

.sponsor-img {
    max-width: 100%;
    /* max-height: 60px; */
    /* Ensure logo fits nicely in the box */
    height: auto;
}

/* Add this to the parent .row container */
.row-flex {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* Ensure the columns behave like flex items */
.row-flex>[class*='col-'] {
    display: flex;
    flex-direction: column;
}

/* Make the card fill the full height of the column */
.row-flex .player-card-custom {
    flex: 1;
    height: auto !important;
    /* Overrides any previous JS-set heights */
    margin-bottom: 30px;
    /* Keeps spacing between rows */
}

/* Custom Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.custom-toast {
    box-sizing: border-box;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease-in-out;
}

.custom-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-info {
    background-color: #17a2b8;
}

.toast-success {
    background-color: #28a745;
}

.toast-warning {
    background-color: #ffc107;
    color: #212529;
}

.toast-danger {
    background-color: #dc3545;
}

.mobile-row-title {
    display: none;
}

/* ==========================================================================
   4. MOBILE OPTIMIZATION (Hybrid List View)
   ========================================================================== */
@media (max-width: 767px) {
    .row-flex .player-card-custom {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        text-align: left;
        margin-bottom: 15px;
        min-height: 100px;
    }

    .player-card-custom .img-frame {
        width: 50%;
        flex-shrink: 0;
    }

    .player-card-custom .card-details {
        width: 50%;
        padding: 10px 15px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .player-card-custom .bottom-fade {
        display: none;
        /* Hide fade on mobile list view */
    }

    .player-card-custom .firstname-txt {
        font-size: 14px;
    }

    .player-card-custom .surname-txt {
        font-size: 18px;
    }

    .player-card-custom .custom-divider {
        margin: 8px 0;
        /* Align left */
        width: 50%;
    }

    .player-card-custom .details-txt {
        font-size: 12px;
    }

    .player-card-custom .jumper-number-container {
        padding: 5px 0 5px 5px;
        justify-content: center;
    }

    .player-card-custom .jumper-number-txt {
        font-size: 35px;
    }

    .desktop-row-title {
        display: none;
    }

    .mobile-row-title {
        display: inline;
        font-size: 22px;
    }
}

/* ==========================================================================
   DESKTOP: COMPACT HORIZONTAL CARDS (Matches Mobile Look)
   ========================================================================== */
@media (min-width: 768px) {
    .row-flex .player-card-custom {
        display: flex;
        flex-direction: row;
        /* Flips the layout: Image left, text right */
        align-items: stretch;
        text-align: left;
        margin-bottom: 20px;
        /* Tighter vertical spacing between rows */
        height: auto !important;
    }

    .player-card-custom .img-frame {
        width: 45%;
        /* Image takes up left 45% */
        flex-shrink: 0;
    }


    .player-card-custom .card-details {
        width: 55%;
        /* Text takes up right 55% */
        padding: 10px 15px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* Hide the white gradient fade, as it doesn't work well horizontally */
    .player-card-custom .bottom-fade {
        display: none;
    }

    /* Scale down the typography to fit the side-by-side layout inside a col-md-4 */
    .player-card-custom .firstname-txt {
        font-size: 18px;
    }

    .player-card-custom .surname-txt {
        font-size: 24px;
        margin-bottom: 5px;
        line-height: 1.1;
    }

    .player-card-custom .custom-divider {
        margin: 8px 0;
        width: 50%;
        /* Aligns left nicely */
    }

    .player-card-custom .details-txt {
        font-size: 12px;
    }

    /* Shrink and center the jumper number */
    .player-card-custom .jumper-number-container {
        padding: 5px 0 5px 10px;
        justify-content: center;
    }

    .player-card-custom .jumper-number-txt {
        font-size: 40px;
    }

    .desktop-row-title {
        font-weight: bold;
        color: #091C3A;
        font-size: 50px;
        text-align: right;
        padding-right: 15px;
    }
}