/* ============================================
   Blue Chip Analytics - Game Pages Styles
   Styles specific to individual game pages
   Tighter, utilitarian design - classic sports data feel
   ============================================ */

/* ===========================================
   DATA GRID LAYOUT FIX - Desktop
   General+Betting paired, Weather full, Travel full
   =========================================== */
@media (min-width: 769px) {
    .data-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    /* Weather and Travel sections span full width */
    .data-grid .data-section:nth-child(3),
    .data-grid .data-section:nth-child(4) {
        grid-column: 1 / -1;
    }
}

/* Game Header */
.game-header {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
}

.matchup {
    font-size: 1.8em;
    font-weight: 700;
    color: #1a365d;
    margin-bottom: 4px;
}

.game-info {
    font-size: 1em;
    color: #666;
    margin-bottom: 4px;
}

/* Game Preview Images */
.game-preview-image {
    text-align: center;
}

.game-preview-image img {
    max-width: 40%;
    height: auto;
    border-radius: 6px;
}

/* Team Info (Away vs Home) */
.team-info {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    margin-top: 6px;
}

.team {
    text-align: center;
}

.team-details {
    color: #666;
    font-size: 0.85em;
    line-height: 1.3;
}

.vs {
    font-size: 1.5em;
    font-weight: 300;
    color: #999;
}

/* Narrative Section */
.narrative-section {
    margin-top: 12px;
}

.narrative-team {
    margin-bottom: 18px;
}

.narrative-team:last-child {
    margin-bottom: 0;
}

.narrative-team-name {
    font-size: 1.2em;
    font-weight: 700;
    color: #1a365d;
    margin-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
}

.narrative-item {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.narrative-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.narrative-title {
    display: block;
    font-size: 1em;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
    line-height: 1.3;
}

.narrative-description {
    font-size: 0.9em;
    line-height: 1.5;
    color: #4a5568;
    margin: 0;
}

/* Weather Components */
.weather-grid {
    display: grid;
    gap: 10px;
}

.weather-main {
    text-align: center;
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
}

.weather-condition {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.weather-icon {
    width: 48px;
    height: 48px;
}

.temp-main {
    font-size: 1.5em;
    font-weight: 700;
    color: #1a365d;
    margin: 0;
}

.weather-forecast-date {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 8px;
}

.weather-details {
    display: grid;
    gap: 0;
}

.weather-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9em;
}

.weather-row:last-child {
    border-bottom: none;
}

/* Betting Information */
.betting-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.betting-item {
    text-align: center;
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
}

.betting-label {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-bottom: 2px;
}

.betting-value {
    display: block;
    font-size: 1.3em;
    font-weight: 700;
    color: #1a365d;
}

/* Travel Information */
.travel-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 769px) {
    .travel-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.travel-team {
    background: #f8fafc;
    border-radius: 6px;
    padding: 10px;
}

.travel-team h4 {
    color: #1a365d;
    margin-bottom: 6px;
    font-size: 0.9em;
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
}

.travel-stats {
    display: grid;
    gap: 0;
}

.travel-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 0.85em;
}

/* ==========================================
   LINE VALUE CALCULATOR - Compact Version
   ========================================== */
.calculator-container {
    background: white;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.calculator-header {
    background: linear-gradient(135deg, #1a365d 0%, #2d4a7c 100%);
    padding: 12px 15px;
    color: white;
    text-align: center;
}

.calculator-header .section-title {
    font-size: 1.1em;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
    border-bottom: none;
    padding-bottom: 0;
}

.calculator-subtitle {
    font-size: 0.8em;
    color: rgba(255,255,255,0.8);
    margin: 0;
}

.calculator-grid {
    display: grid;
    gap: 12px;
    padding: 10px;
}

/* Calculator Sections */
.calc-section {
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.calc-section-title {
    font-size: 0.8em;
    font-weight: 600;
    color: #1a365d;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 5px;
    padding-bottom: 3px;
    border-bottom: 1px solid #e2e8f0;
}

.calc-row {
    display: grid;
    grid-template-columns: 1fr 100px 55px;
    align-items: center;
    padding: 2px 0;
    gap: 8px;
    font-size: 0.85em;
    line-height: 1.3;
}

.calc-label {
    color: #4a5568;
}

.calc-value {
    font-weight: 600;
    color: #1a202c;
    text-align: right;
    white-space: nowrap;
}

.calc-input {
    width: 100%;
    padding: 4px 6px;
    font-size: 0.85em;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    text-align: center;
}

.calc-input:focus {
    outline: none;
    border-color: #1a365d;
    box-shadow: 0 0 0 2px rgba(26, 54, 93, 0.15);
}

/* Section title with inline input */
.calc-section-title-with-input {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
    font-weight: 600;
    color: #1a365d;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 5px;
    padding-bottom: 3px;
    border-bottom: 1px solid #e2e8f0;
}

.calc-section-title-with-input span {
    flex: 1;
}

.calc-section-title-with-input .calc-input {
    margin-left: 10px;
    width: 55px;
    flex-shrink: 0;
}

/* Highlighted input (blue border) */
.calc-input-highlight {
    border: 2px solid #3182ce;
    background: #ebf8ff;
}

.calc-input-highlight:focus {
    border-color: #2b6cb0;
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.25);
}

/* Your Line section */
.calc-your-line {
    background: linear-gradient(135deg, #e6f3ff 0%, #dbeafe 100%);
    border: 1px solid #3182ce;
}

.calc-your-line .calc-label {
    font-weight: 600;
    color: #1a365d;
}

.calc-your-line .calc-value {
    font-size: 1.1em;
    font-weight: 700;
    color: #1a365d;
}

.calc-highlight {
    color: #2b6cb0;
}

/* Line Calculation Section */
.calc-results {
    background: #fff;
}

/* Implied Value Box */
.calc-implied-value {
    background: linear-gradient(135deg, #1a365d 0%, #2d4a7c 100%);
    border: none;
    padding: 8px 10px !important;
}

.implied-value-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.implied-label {
    color: rgba(255,255,255,0.95);
    font-weight: 600;
    font-size: 0.9em;
}

.implied-amount {
    font-size: 1.4em;
    font-weight: 700;
    color: #48bb78;
    background: rgba(255,255,255,0.1);
    padding: 3px 10px;
    border-radius: 4px;
}

/* Time Display Elements */
#header-time,
#general-info-time {
    cursor: help;
}

/* ==========================================
   RESPONSIVE - Mobile First
   ========================================== */
@media (max-width: 768px) {
    .game-preview-image img {
        max-width: 100%;
    }
    
    .game-header {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .matchup {
        font-size: 1.3em;
        margin-bottom: 4px;
    }
    
    .game-info {
        font-size: 0.9em;
        margin-bottom: 2px;
    }
    
    .team-info {
        grid-template-columns: 1fr auto 1fr;
        gap: 6px;
        align-items: center;
        margin-top: 4px;
    }
    
    .team {
        padding: 2px;
    }
    
    .team-details {
        font-size: 0.65em;
        line-height: 1.2;
    }
    
    .vs {
        font-size: 0.85em;
        opacity: 0.6;
    }
    
    .final-score {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 8px;
    }
    
    .final-score .score {
        font-size: 1.4em;
        font-weight: 700;
        color: #1a365d;
    }
    
    .final-score .final-label {
        font-size: 0.7em;
        font-weight: 600;
        color: #666;
        letter-spacing: 0.5px;
    }
    
    .betting-result {
        margin-top: 12px;
        padding: 8px 12px;
        background: #f8fafc;
        border-radius: 6px;
        text-align: center;
        font-size: 0.75em;
        color: #4a5568;
        line-height: 1.4;
    }
    
    .narrative-team-name {
        font-size: 1.1em;
    }
    
    .narrative-title {
        font-size: 0.95em;
    }
    
    .narrative-description {
        font-size: 0.85em;
    }
    
    /* MOBILE BETTING - Compact layout */
    .betting-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-bottom: 6px;
    }
    
    .betting-item {
        padding: 6px;
    }
    
    .betting-label {
        font-size: 0.7em;
        margin-bottom: 1px;
    }
    
    .betting-value {
        font-size: 1em;
    }
    
    /* Power Rank Implied Line compact */
    .betting-section .data-row {
        padding: 4px 0;
        font-size: 0.8em;
    }
    
    .travel-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .travel-team {
        padding: 8px;
    }
    
    .travel-team h4 {
        font-size: 0.8em;
        margin-bottom: 4px;
    }
    
    .travel-row {
        font-size: 0.75em;
        padding: 1px 0;
    }
    
    /* MOBILE CALCULATOR - Tight single-line rows */
    .calculator-header {
        padding: 8px 10px;
    }
    
    .calculator-header .section-title {
        font-size: 1em;
    }
    
    .calculator-subtitle {
        font-size: 0.75em;
    }
    
    .calculator-grid {
        padding: 8px;
        gap: 8px;
    }
    
    .calc-section {
        padding: 6px 8px;
    }
    
    .calc-section-title {
        font-size: 0.7em;
        margin-bottom: 4px;
        padding-bottom: 3px;
    }
    
    .calc-section-title-with-input {
        font-size: 0.7em;
        margin-bottom: 4px;
        padding-bottom: 3px;
    }
    
    .calc-section-title-with-input .calc-input {
        width: 45px;
        padding: 3px 4px;
        font-size: 0.85em;
    }
    
    /* KEY FIX: Grid layout for aligned columns */
    .calc-row {
        grid-template-columns: 1fr 85px 45px;
        font-size: 0.8em;
        padding: 2px 0;
        gap: 6px;
    }
    
    .calc-input {
        padding: 2px 4px;
        font-size: 0.8em;
    }
    
    .implied-value-row {
        padding: 0;
    }
    
    .implied-label {
        font-size: 0.8em;
    }
    
    .implied-amount {
        font-size: 1.1em;
        padding: 2px 6px;
    }
    
    .weather-icon {
        width: 40px;
        height: 40px;
    }
    
    .temp-main {
        font-size: 1.3em;
    }
    
    .weather-row {
        font-size: 0.8em;
        padding: 3px 0;
    }
}

@media (max-width: 480px) {
    .game-header {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .matchup {
        font-size: 1.15em;
    }
    
    .team-info {
        gap: 4px;
    }
    
    .team {
        padding: 2px;
    }
    
    .team-details {
        font-size: 0.6em;
    }
    
    .final-score {
        gap: 6px;
        padding: 6px;
    }
    
    .final-score .score {
        font-size: 1.2em;
    }
    
    .final-score .final-label {
        font-size: 0.65em;
    }
    
    .betting-result {
        margin-top: 10px;
        padding: 6px 10px;
        font-size: 0.7em;
    }
    
    .narrative-team-name {
        font-size: 1em;
    }
    
    .narrative-title {
        font-size: 0.9em;
    }
    
    .narrative-description {
        font-size: 0.8em;
    }
    
    .weather-condition {
        flex-direction: column;
        gap: 6px;
    }
    
    .weather-icon {
        width: 36px;
        height: 36px;
    }
    
    .temp-main {
        font-size: 1.2em;
    }
    
    /* Extra tight betting on small screens */
    .betting-grid {
        gap: 4px;
    }
    
    .betting-item {
        padding: 4px;
    }
    
    .betting-label {
        font-size: 0.65em;
    }
    
    .betting-value {
        font-size: 0.95em;
    }
    
    .travel-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .travel-team {
        padding: 6px;
    }
    
    .travel-team h4 {
        font-size: 0.75em;
    }
    
    .travel-row {
        font-size: 0.7em;
    }
    
    /* Calculator extra small - ultra tight */
    .calculator-header {
        padding: 6px 8px;
    }
    
    .calculator-header .section-title {
        font-size: 0.95em;
    }
    
    .calc-section-title-with-input {
        font-size: 0.65em;
    }
    
    .calc-section-title-with-input .calc-input {
        width: 40px;
        padding: 2px 3px;
        font-size: 0.8em;
    }
    
    .calculator-subtitle {
        font-size: 0.7em;
    }
    
    .calculator-grid {
        padding: 6px;
        gap: 6px;
    }
    
    .calc-section {
        padding: 5px 6px;
    }
    
    .calc-section-title {
        font-size: 0.65em;
        margin-bottom: 3px;
        padding-bottom: 2px;
    }
    
    .calc-row {
        grid-template-columns: 1fr 75px 40px;
        font-size: 0.75em;
        padding: 1px 0;
        gap: 4px;
    }
    
    .calc-input {
        padding: 2px 3px;
        font-size: 0.75em;
    }
    
    .implied-amount {
        font-size: 1em;
        padding: 2px 5px;
    }
}

/* ==========================================
   RESPONSIVE - Tablet and Desktop
   ========================================== */
@media (min-width: 769px) {
    .calculator-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        align-items: stretch;
    }
    
    .calculator-left,
    .calculator-right {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    /* Ensure calc sections fill available space */
    .calculator-left .calc-section,
    .calculator-right .calc-section {
        flex: 0 0 auto;
    }
    
    /* Make implied value stick to bottom of left column */
    .calc-implied-value {
        margin-top: auto;
    }
}

@media (min-width: 900px) {
    .game-header {
        padding: 18px;
    }
    
    .matchup {
        font-size: 2em;
    }
    
    .team-name {
        font-size: 1.4em;
    }
    
    .team-details {
        font-size: 0.9em;
    }
    
    .calculator-grid {
        padding: 12px;
    }
}
