/* static/css/best_matchups_redesign.css */

/* === FONT IMPORTS (already in HTML) === */
/* @import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap'); */

/* === GLOBAL RESET & BASE STYLES === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px; /* Base font size */
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #0D1117; /* Darker, more neutral background */
    color: #C9D1D9; /* Off-white for text, less stark than pure white */
    font-family: 'Manrope', sans-serif;
    line-height: 1.6;
    padding-top: 68px; /* Existing nav height */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative; /* For pseudo-elements like background noise if kept */
    overflow-x: hidden; /* Prevent horizontal scroll that shifts the nav */
}

/* Optional: Keep subtle noise background, can be removed if too distracting */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="1" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.05"/%3E%3C/svg%3E');
    z-index: -1;
    opacity: 0.05; /* Reduced opacity */
}


main {
    flex: 1 0 auto;
    width: 100%;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600; /* Default bold for headings */
    color: #F0F6FC; /* Brighter white for headings */
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

h1 { font-size: 2.8rem; font-weight: 700; }
h2 { font-size: 2rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 500; }
h4 { font-size: 1.25rem; font-weight: 500; }

p {
    margin-bottom: 1rem;
}

a {
    color: #58A6FF; /* Apple-like blue for links */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: #80BFFF;
    text-decoration: underline;
}

/* === CONTAINER === */
.bm-container {
    width: 100%;
    max-width: 1100px; /* Max width for content */
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px; /* Padding for smaller screens */
    margin-top: 2rem; /* Space from title */
    margin-bottom: 3rem; /* Space before footer */
}

/* === TITLE SECTION === */
.title-section {
    background: transparent; /* Remove distinct background color */
    color: #F0F6FC;
    padding: 2.5rem 20px 2rem; /* Adjusted padding */
    text-align: center;
    border-bottom: 1px solid #21262D; /* Subtle separator line */
}

.title-section::before {
    display: none; /* Remove radial gradient from original */
}

.title-section h1 {
    font-size: 2.5rem; /* Slightly reduced for a cleaner look */
    font-weight: 700; /* Keep it impactful */
    color: #F0F6FC;
    margin-bottom: 0.5rem;
    text-shadow: none; /* Remove text shadow */
    letter-spacing: -0.5px; /* Slightly tighter letter spacing */
}

.title-section h1::after {
    /* Remove or simplify the underline animation if desired */
    display: none; /* Removing the animated underline for now */
}

.matchup-date {
    font-size: 1rem;
    font-weight: 500;
    color: #8B949E; /* Softer color for date */
    margin-bottom: 0.75rem;
    letter-spacing: 0.2px;
    text-transform: none; /* Removing uppercase for a softer feel */
}

.matchup-subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: #8B949E; /* Softer color */
    max-width: 700px; /* Constrain width */
    margin: 0 auto;
    line-height: 1.6;
}

/* === FOOTER (Basic consistency) === */
.bm-footer {
    padding: 40px 20px;
    background: #0D1117; /* Match body */
    color: #8B949E; /* Softer text color */
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid #21262D; /* Consistent separator */
}
.bm-footer .footer-links a {
    color: #8B949E;
    margin: 0 10px;
}
.bm-footer .footer-links a:hover {
    color: #58A6FF;
}
.bm-footer p {
    margin-top: 0.5rem;
    margin-bottom: 0;
    opacity: 0.8;
}

/* === UTILITIES (Optional) === */
.sr-only { /* For screen readers */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Animations from original, can be kept or removed */
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(15px); } /* Reduced distance */
    100% { opacity: 1; transform: translateY(0); }
}

/* Remove particle and background glow for cleaner look, can be re-added if desired */
.background-glow, .particle-container {
    display: none;
}

/* Team Badge - general styling, specific colors are inline */
.team-badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem; /* Slightly more modern border-radius */
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    /* Ensure high contrast for text on badges - handled by team_text_colors or default white */
}

/* Styles for .matchup-block and its children will be added next */

/* === MATCHUP BLOCK STYLING === */
.matchup-block {
    background-color: #161B22; /* Slightly lighter than body for card effect */
    border: 1px solid #30363D; /* Subtle border */
    border-radius: 8px; /* Consistent border radius */
    margin-bottom: 2.5rem; /* Space between matchup blocks */
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* Soft shadow for depth */
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.matchup-block:hover {
    border-color: #58A6FF; /* Highlight on hover */
}

.matchup-block__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping for smaller screens */
    gap: 1rem; /* Space between title and button */
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #21262D; /* Separator line */
}

.matchup-block__title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0; /* Override default heading margin */
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem; /* Space between team elements */
}

.matchup-block__team-name {
    color: #F0F6FC;
    font-weight: 500;
}

.matchup-block__vs {
    color: #8B949E; /* Softer color for "vs" */
    font-weight: 400;
    font-size: 1rem;
}

.matchup-block__time {
    font-size: 0.95rem;
    color: #8B949E;
    font-weight: 400;
    margin-left: 0.5rem;
}

.matchup-block__view-full-btn {
    background-color: #1F6FEB; /* Primary action blue */
    color: #FFFFFF;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5em 1em;
    border-radius: 6px;
    border: 1px solid #1F6FEB; /* Border same as background for solid feel */
    text-decoration: none;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
    white-space: nowrap;
}

.matchup-block__view-full-btn:hover {
    background-color: #388BFD; /* Lighter blue on hover */
    border-color: #388BFD;
    color: #FFFFFF;
    text-decoration: none;
}

.matchup-block__content-wrapper {
    display: grid;
    grid-template-columns: 1fr; /* Default to single column */
    gap: 2rem; /* Space between pitcher and hitters sections */
}

@media (min-width: 768px) { /* Tablet and above */
    .matchup-block__content-wrapper {
        grid-template-columns: 0.75fr 1.25fr; /* Pitcher section takes less space */
        gap: 2.5rem;
    }
}


.matchup-block__section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #F0F6FC;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #21262D;
}

.matchup-block__section-subtitle {
    font-size: 0.9rem;
    font-weight: 400;
    color: #8B949E;
}

/* Pitcher Section */
.matchup-block__pitcher-card {
    background-color: #0D1117; /* Slightly darker than block for contrast */
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #30363D;
}

.matchup-block__pitcher-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #F0F6FC;
    margin-bottom: 0.5rem;
}

.matchup-block__pitcher-team-abbr {
    font-size: 0.9rem;
    font-weight: 400;
    color: #8B949E;
    margin-left: 0.25rem;
}

.matchup-block__pitcher-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem; /* Row and column gap */
    font-size: 0.95rem;
    color: #C9D1D9;
}

.matchup-block__stat-item {
    font-weight: 500;
}
.matchup-block__stat-item strong { /* If we use strong tags for labels */
    color: #8B949E;
    font-weight: 400;
    margin-right: 0.25rem;
}


/* Hitters Section */
.matchup-block__hitters-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default single column for hitters */
    gap: 1rem;
}

/* On larger screens, maybe 2 columns for hitters if space allows and design fits */
@media (min-width: 992px) {
    .matchup-block__hitters-grid {
         /* Keep as 1 column for now for clarity, can be changed to 2 if preferred */
        /* grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); */
    }
}

.matchup-block__hitter-card {
    background-color: #0D1117; /* Match pitcher card background */
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #30363D;
    transition: border-color 0.2s ease-in-out;
}

.matchup-block__hitter-card:hover {
    border-color: #58A6FF;
}

.matchup-block__hitter-name-wrapper {
    display: flex;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.matchup-block__hitter-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0; /* Reset default */
}
.matchup-block__hitter-name a.matchup-block__hitter-link {
    color: #F0F6FC;
    text-decoration: none;
}
.matchup-block__hitter-name a.matchup-block__hitter-link:hover {
    text-decoration: underline;
    color: #58A6FF;
}

.matchup-block__hitter-team-abbr {
    font-size: 0.85rem;
    font-weight: 400;
    color: #8B949E;
    margin-left: 0.35rem;
}

.matchup-block__hitter-stats {
    font-size: 0.9rem;
    color: #C9D1D9;
    margin-bottom: 0.75rem;
}
.matchup-block__hitter-stats .matchup-block__stat-line {
    margin-bottom: 0.25rem;
    line-height: 1.5;
}
.matchup-block__hitter-stats .matchup-block__stat-line--secondary {
    font-size: 0.85rem;
    color: #8B949E;
}


.matchup-block__hitter-trends {
    font-size: 0.85rem;
    display: flex;
    flex-direction: column; /* Stack trends vertically */
    gap: 0.3rem; /* Space between trend lines */
}

.matchup-block__hitter-trend {
    color: #C9D1D9;
    padding: 0.25rem 0.5rem;
    background-color: rgba(88, 166, 255, 0.1); /* Subtle blue highlight for trends */
    border-radius: 4px;
    border: 1px solid rgba(88, 166, 255, 0.2);
}

.matchup-block__hitter-trend strong {
    color: #F0F6FC; /* Brighter color for the stat label part */
    font-weight: 600;
}


/* Responsive adjustments for title section and container */
@media (max-width: 768px) {
    .title-section h1 {
        font-size: 2rem;
    }
    .title-section {
        padding: 2rem 15px 1.5rem;
    }
    .matchup-subtitle {
        font-size: 1rem;
    }
    .bm-container {
        padding: 0 15px;
        margin-top: 1.5rem;
    }

    .matchup-block {
        padding: 1rem;
    }

    .matchup-block__header {
        flex-direction: column; /* Stack title and button on small screens */
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    .matchup-block__title {
        font-size: 1.25rem;
    }
    .matchup-block__view-full-btn {
        width: 100%; /* Make button full width */
        text-align: center;
    }

    .matchup-block__content-wrapper {
        grid-template-columns: 1fr; /* Force single column */
        gap: 1.5rem;
    }
    .matchup-block__section-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .title-section h1 {
        font-size: 1.8rem;
    }
    .matchup-date {
        font-size: 0.9rem;
    }
    .matchup-subtitle {
        font-size: 0.95rem;
    }
    .matchup-block__title {
        font-size: 1.1rem;
        gap: 0.3rem 0.5rem; /* Reduce gap for team elements */
    }
    .team-badge {
        font-size: 0.75rem;
        padding: 0.2em 0.5em;
    }
    .matchup-block__time {
        font-size: 0.85rem;
    }
}

/* Style for Google login link */
.google-login {
    background-color: #4285F4;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}
.google-login:hover {
    background-color: #357ae8;
    color: #fff;
}