/* ----------------------------------------
   UHS Matchup Simulator Styles
   Theme: Union College Garnet & White
-----------------------------------------*/

#uhs-sim-wrapper {
    background: #111;
    color: #fff;
    padding: 25px;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* Headers */
#uhs-sim-wrapper h2 {
    color: #ffffff; /* Classic Season Matchup in pure white */
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.uhs-sim-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #222;
    padding-bottom: 10px;
}

.uhs-tab-btn {
    background: #222;
    color: #aaa;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.uhs-tab-btn.active, .uhs-tab-btn:hover {
    background: #822433; /* True Union Garnet */
    color: #fff;
}

.uhs-sim-section { display: none; }
.uhs-sim-section.active { display: block; }

.uhs-flex-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
}

.uhs-card {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #2b2b2b;
    flex-grow: 1;
}

.width-45 { width: 45%; }
.line-row {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.uhs-select, .uhs-skater-select, .uhs-goalie-select {
    width: 100%;
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #444;
    padding: 8px; /* More padding for readability */
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: nowrap; /* Prevents text wrap */
    overflow: hidden;
    text-overflow: ellipsis; /* Adds ... if name is too long */
}

/* Force white text for headers */
.uhs-card h3 { color: #ffffff !important; }

/* Versus Elements */
.uhs-vs { 
    font-size: 2.5rem; 
    font-weight: 900; 
    color: #822433; /* True Union Garnet */
    align-self: center;
}
.uhs-vs-mid { 
    font-size: 1.8rem; 
    font-weight: 900; 
    color: #822433; /* True Union Garnet */
    align-self: center;
    margin-top: 100px;
}

/* Primary Action Buttons */
.uhs-btn-primary {
    background: #822433; /* True Union Garnet, not red */
    color: #fff;
    border: none;
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.uhs-btn-primary:hover { 
    background: #5c1823; /* Darker Garnet on hover */
}

.uhs-hidden { display: none; }
.uhs-visible { display: block; margin-top: 30px; }

/* Custom Lineup Builder Grid Styles */
.uhs-pos-header {
    margin: 20px 0 10px 0;
    font-size: 0.95rem;
    color: #aaa;
    text-transform: uppercase;
    border-bottom: 2px solid #2b2b2b;
    padding-bottom: 5px;
}
.uhs-line-group {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
}
.uhs-line-label {
    font-size: 0.8rem;
    font-weight: bold;
    color: #aaa;
    width: 25px;
    text-align: center;
}
.uhs-line-group select {
    flex: 1;
    min-width: 0;
}

/* Statistical Odds Banner Styles */
.uhs-odds-banner {
    background: #e6e6e6; /* Athletic Light Grey */
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 25px;
    text-align: center;
}
.odds-label {
    font-size: 0.9rem;
    color: #333;
    text-transform: uppercase;
    margin-bottom: 12px;
    font-weight: bold;
    letter-spacing: 1px;
}
.odds-bar-container {
    display: flex;
    height: 35px;
    background: #ccc;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}
.odds-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #fff;
    font-size: 0.95rem;
    transition: width 0.8s ease;
}
.a-bar { background: #822433; } /* Union Garnet */
.b-bar { background: #555; } /* Neutral Dark Grey for opponent */
.odds-names {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #333;
    font-weight: bold;
}

/* Boxscore Table UI Styles */
.uhs-boxscore-wrapper {
    background: #e6e6e6; /* Athletic Light Grey to make Garnet text legible */
    color: #111;
    padding: 20px;
    border: 3px solid #822433;
    border-radius: 8px;
    margin-top: 25px;
    animation: fadeIn 0.5s ease-in;
}

.uhs-boxscore-wrapper h3 {
    color: #111;
    border-bottom: 2px solid #ccc;
    padding-bottom: 5px;
    margin-top: 20px;
    text-transform: uppercase;
    font-size: 1.1rem;
}

.uhs-box-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    background: #f5f5f5; /* Lighter grey for table background */
}

.uhs-box-table th, .uhs-box-table td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: center;
}

.uhs-box-table th {
    background: #822433; /* Garnet header */
    color: #fff;
    text-transform: uppercase;
    font-weight: bold;
}

.uhs-box-table td {
    color: #822433; /* Garnet text on grey background */
    font-weight: bold;
}

.uhs-box-events {
    list-style: none;
    padding: 0;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.uhs-box-events li {
    padding: 8px 12px;
    border-bottom: 1px dotted #ccc;
    color: #822433; /* Garnet text on grey background */
    font-weight: 600;
}

.uhs-box-events li:last-child {
    border-bottom: none;
}

.uhs-box-disclaimer {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #555;
    font-style: italic;
    text-align: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- UI EXPANSION FIXES (STACKED LAYOUT) --- */

/* 1. Stack cards vertically at 100% width */
.uhs-flex-grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch; 
    margin-bottom: 25px;
}

/* 2. Ensure cards take up the full available width */
.uhs-flex-grid .uhs-card {
    width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 0 !important;
    box-sizing: border-box;
}

/* 3. Maximize dropdown readability */
.uhs-select, .uhs-skater-select, .uhs-goalie-select {
    padding: 10px 8px !important;
    font-size: 0.95rem !important;
    width: 100%;
    box-sizing: border-box;
}

/* 4. Display the 'VS' text prominently between the cards */
.uhs-vs-mid {
    display: block !important; 
    text-align: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: #822433; /* Deep red to match the theme */
    margin: 15px 0;
    width: 100%;
}

/* 5. Adaptive Boxscore Columns */
.uhs-box-table {
    width: 100%;
    table-layout: auto; 
}

/* Player Name Column: Push other columns to the right */
.uhs-box-table th:first-child, 
.uhs-box-table td:first-child {
    width: 100%; 
    text-align: left;
    white-space: nowrap; 
}

/* Stat Columns: Auto-size perfectly to their content */
.uhs-box-table th:not(:first-child), 
.uhs-box-table td:not(:first-child) {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    text-align: center;
    padding-left: 8px !important; /* Adds a nice adaptive buffer */
    padding-right: 8px !important;
    white-space: nowrap; /* Forces the column to be as wide as its header/data */
}

/* Ensure the table allows horizontal scrolling on mobile devices */
.uhs-table-scroll {
    overflow-x: auto;
    width: 100%;
}