/* Base Styles */
:root {
    --primary-color: #00205B;      /* Default Navy */
    --secondary-color: #EFBF04;    /* Default Gold */
    --accent-color: #000000;       /* Default Black */
    --text-light: #FFFFFF;
    --text-dark: #333333;
    --background-light: #F5F5F5;
    --background-dark: #1A1A2E;
    --card-background: #FFFFFF;
    --border-color: rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
    --app-header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background-color: var(--background-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background var(--transition-speed);
    padding-bottom: var(--app-header-height); /* Add padding for fixed header at bottom */
    overflow-x: hidden; /* Prevent horizontal scrolling on the body */
}

/* Header Styles (now at bottom) */
.app-header {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px var(--shadow-color);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    /* height: var(--app-header-height); */ /* TEMPORARILY COMMENTED OUT FOR TEST */
    overflow: visible !important;         /* ADDED FOR TEST */
    transition: background-color var(--transition-speed);
}

.nav-section {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: flex-end; /* Position on the right */
    flex: 1;
}

.title-section {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: flex-start; /* Position on the left */
    margin-right: auto;
}

#home-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    transition: color var(--transition-speed);
}

#home-link:hover {
    color: var(--secondary-color);
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.nav-button {
    background-color: transparent;
    color: var(--text-light);
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all var(--transition-speed);
    font-size: 0.95rem;
}

.nav-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Search Styles */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 0 15px;
    width: 100%;
    max-width: 300px;
}

.search-icon {
    color: rgba(255, 255, 255, 0.8);
    margin-right: 10px;
}

#search-input {
    background-color: transparent;
    border: none;
    color: var(--text-light);
    padding: 10px 0;
    width: 100%;
    outline: none;
    font-size: 0.95rem;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-results-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 300px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-bottom: 10px;
}

.search-results-dropdown.active {
    display: block;
}

.search-result-category {
    padding: 10px 15px;
    font-weight: bold;
    color: var(--text-dark);
    border-bottom: 1px solid #eee;
    background-color: #f8f8f8;
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color var(--transition-speed);
    color: var(--text-dark); /* ADD THIS LINE */
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.search-result-item .result-title {
    font-weight: bold;
    margin-bottom: 3px;
    color: var(--text-dark); /* ADD THIS LINE */
}

.search-result-item .result-subtitle {
    font-size: 0.85rem;
    color: #666;
}

/* Main Content Styles */
main {
    flex: 1;
    width: 100%;
}

#content-container {
    width: 100%;
}

.view-container {
    width: 100%;
}

.view-title {
    color: var(--primary-color);
    padding: 20px;
    font-size: 1.75rem;
    border-bottom: 1px solid #e0e0e0;
}

/* Full Width Header Styles */
.full-width-header {
    position: relative;
    width: 100%;
    height: 40vh; /* Increase height to take up more space */
    min-height: 300px;
    overflow: hidden;
}

.header-image-container {
    width: 100%;
    height: 100%;
    overflow: hidden; /* If not already set, helps with child sizing */
}

.header-image, .team-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
}

.header-title {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

.achievement-badge {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--accent-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Schools Grid Styles */
.schools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.school-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: pointer;
    height: 220px;
    transition: transform var(--transition-speed);
}

.school-card:hover {
    transform: translateY(-5px);
}

.card-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.card-media i {
    font-size: 3rem;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
    color: white;
    z-index: 2;
}

.card-title {
    color: var(--text-light);
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.card-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* School Detail Styles */
.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.category-card {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform var(--transition-speed);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    text-align: center;
    padding: 40px 20px; /* Increased height */
    min-height: 210px; /* Minimum height */
    position: relative; /* For absolute positioning of content */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card .card-media {
    position: relative;
    background-color: transparent;
    height: auto;
    padding: 20px 0;
    z-index: 2; /* Above gradient */
}

.category-card .card-media i {
    font-size: 3rem;
    color: var(--secondary-color);
}

.category-card .card-title {
    color: var(--text-light);
    font-size: 1.3rem;
    position: relative;
    z-index: 2; /* Above gradient */
}

/* Sports Sections Styles */
.sports-sections {
    padding: 20px;
}

.sport-section {
    margin-bottom: 0px;
}

.section-title {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--secondary-color);
}

/* Horizontal Scroll Styles - UPDATED for touch scrolling and fading edges */
.horizontal-scroll-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.horizontal-scroll-wrapper {
    flex: 1;
    overflow-x: auto;
    position: relative;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS */
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
    padding: 10px 0; /* Add padding to pull content from edges */
    min-width: 0; /* Allow proper shrinking in flex */
    width: 100%; /* Ensure it takes full width */
    margin-left: -20px; /* Create negative space for the fade effect */
    padding-left: 20px; /* Offset the negative margin */
}

.horizontal-scroll-wrapper::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.horizontal-scroll-content {
    display: flex;
    gap: 15px;
    padding: 10px 0; /* Reduced horizontal padding to extend content */
    transition: transform 0.3s ease;
    min-height: 240px; /* Ensure minimum height for cards */
    padding-left: 60px;  /* Increased to push first item past the fade */
    padding-right: 80px; /* Keep increased padding to allow last item to clear the fade */
}

.scroll-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-speed);
    z-index: 10;
    flex-shrink: 0;
    position: absolute; /* Position absolutely so content can extend underneath */
    opacity: 0.7;
}

.left-arrow {
    left: 0;
}

.right-arrow {
    right: 0;
}

.scroll-arrow:hover {
    background-color: var(--secondary-color);
    color: var(--accent-color);
    opacity: 0.7;
}

.scroll-arrow.hidden {
    visibility: hidden;
    opacity: 0;
}

/* Add fade effect to horizontal scroll - IMPROVED */
.horizontal-scroll-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -20px; /* Move fade to the left by the same amount as the negative margin */
    height: 100%;
    width: 80px; /* Increased width to maintain same fade span */
    z-index: 5;
    pointer-events: none;
    background: linear-gradient(to right, rgba(245, 245, 245, 1) 0%, rgba(245, 245, 245, 0.8) 40%, rgba(245, 245, 245, 0) 100%);
}

.horizontal-scroll-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0; /* Start at the edge */
    height: 100%;
    width: 60px; /* Extend past the arrow */
    z-index: 5;
    pointer-events: none;
    background: linear-gradient(to left, rgba(245, 245, 245, 1) 0%, rgba(245, 245, 245, 0.8) 40%, rgba(245, 245, 245, 0) 100%);
}

/* Add a pseudo-element to create extra scrollable space at the end */
.horizontal-scroll-content::after {
    content: '';
    display: block;
    min-width: 40px; /* Extra space at the end */
    height: 1px; /* Nearly invisible height */
    flex-shrink: 0; /* Prevent shrinking */
}

/* Sport Year Card Styles */
.sport-year-card {
    min-width: 200px;
    height: 170px; /* Fixed height */
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform var(--transition-speed);
    flex-shrink: 0;
    position: relative; /* For positioning content */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Push content to bottom */
}

.sport-year-card:hover {
    transform: translateY(-5px);
}

.sport-year-card .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
    color: white;
    z-index: 2;
}

.sport-year-card .card-title {
    color: var(--text-light);
    font-size: 1.5rem;
    margin-bottom: 5px;
    font-weight: bold;
}

.sport-year-card .card-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Team Detail Styles */
.team-content {
    display: grid;
    /* Explicitly define a single column that takes up available space and can shrink */
    grid-template-columns: minmax(0, 1fr); 
    grid-template-rows: auto auto;
    gap: 20px;
    padding: 20px;
    /* overflow: hidden; */ /* Consider adding this if issues persist, but minmax should be enough */
}

.awards-section, .roster-section {
    width: 100%;
    margin-bottom: 20px;
    min-width: 0; /* Ensure these sections themselves can shrink if their content is too wide */
    /* overflow: hidden; */ /* Optional: if you want to strictly clip content within these sections */
}

.trophy-container {
    width: 100%;
    max-width: 300px;
    height: 325px; /* Match player card height */
    position: relative;
    background-color: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin: 0 auto;
}

.trophy-model-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
}

.trophy-placeholder {
    width: 100%;
    height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--background-light);
    border-radius: 8px;
}

.trophy-placeholder svg {
    width: 60%;
    max-width: 120px;
    height: auto;
    margin-bottom: 10px;
}

/* UPDATED Player Card Styles - Based on mockups */
.player-card {
    min-width: 180px;
    height: 280px; /* Slightly taller */
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all var(--transition-speed);
    flex-shrink: 0;
    position: relative;
    color: var(--text-dark);
}

.player-card[data-expanded="true"] {
    min-width: 280px;
    height: 280px; /* Same height, only expand horizontally */
    z-index: 10;
    background-color: var(--background-dark);
    color: var(--text-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.player-card-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.player-card-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    height: 100%;
    gap: 10px;
}

.player-media {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 15px auto 10px;
    overflow: hidden; /* Crucial for circular shape with img/video child */
    flex-shrink: 0;
    background-color: var(--accent-color); /* Fallback if media fails/SVG shown */
    display: flex; /* To center SVG fallback if needed */
    justify-content: center;
    align-items: center;
    border: 3px solid var(--secondary-color);
}

.player-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-media svg {
    width: 60%;
    height: 60%;
}

.player-info {
    padding: 0 10px;
}

.player-name {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.2rem;
    text-align: center;
}

.player-card:not([data-expanded="true"]) .player-name {
    color: var(--text-dark);
}

.player-number, .player-position {
    text-align: center;
}

/* Player card expanded section */
.player-card-expanded {
    display: none; /* Hidden by default */
    padding: 15px;
    background-color: transparent; /* Make it transparent instead of overlay */
    width: 55%;
}

.player-card[data-expanded="true"] .player-card-expanded {
    display: block; /* Show when expanded */
    position: static; /* Not absolute, to flow with content */
}

.expanded-stats {
    padding-top: 10px;
}

.player-card[data-expanded="true"] .player-stats-container {
    display: flex;
    flex-direction: column; /* Stack stats vertically */
    gap: 8px;
    margin-top: 10px;
}

.player-card[data-expanded="true"] .player-stat {
    width: 100%;
    text-align: center;
    padding: 6px 8px;
}

.view-full-profile {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1rem;
    transition: color var(--transition-speed);
    width: 30px;
    height: 30px;
    display: none; /* Only show when expanded */
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.player-card[data-expanded="true"] .view-full-profile {
    display: flex;
}

.view-full-profile:hover {
    color: var(--secondary-color);
    transform: scale(1.1);
}

/* All Players Card Style - different from roster cards */
.all-players-grid .player-card {
    height: 160px;
    display: flex;
    flex-direction: row;
    background-color: white;
}

.all-players-grid .player-card-compact {
    flex-direction: row;
    width: 100%;
    padding: 10px;
    gap: 15px;
}

.all-players-grid .player-media {
    width: 60px;
    height: 60px;
}

.all-players-grid .player-info {
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.all-players-grid .player-name {
    font-size: 1.2rem;
    white-space: normal;
}

.all-players-grid .view-full-profile {
    display: flex;
}

/* Athletes Styles */
.athlete-card {
    min-width: 180px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-speed);
    flex-shrink: 0;
    position: relative;
    color: var(--text-dark);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 20px;
    height: 250px; /* Fixed height */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.athlete-card-content,
.athlete-card-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.athlete-media {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden; /* Crucial for circular shape */
    flex-shrink: 0;
    background-color: var(--accent-color); /* Fallback background */
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid var(--secondary-color);
    margin-bottom: 15px;
}

.athlete-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.athlete-info {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.athlete-name {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: var(--text-dark);
}

.athlete-graduation, .athlete-sport {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.athlete-card-expanded {
    display: none;
}

.athlete-affiliation {
    margin-top: 10px;
    color: var(--secondary-color);
    font-weight: bold;
}

/* Player Detail View Styles - IMPROVED BASED ON MOCKUPS */
.player-detail-view {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.player-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.player-images-carousel {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
    max-width: 600px;
}

.carousel-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    height: 300px; /* Taller for better image display */
    border-radius: 8px;
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
}

.carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity var(--transition-speed);
    display: flex; /* Helps center content if it's not full size */
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Added for safety */
}

.carousel-item.active {
    opacity: 1;
    z-index: 5;
}

.carousel-item img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.carousel-nav {
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    margin: 0 10px;
    transition: all var(--transition-speed);
}

.carousel-nav:hover {
    background-color: var(--secondary-color);
    color: var(--accent-color);
}

.player-info {
    text-align: center;
    margin-bottom: 20px;
}

.player-name {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.player-number-position, .player-team {
    color: #666;
    margin-bottom: 5px;
}

.player-sports-section {
    margin: 30px 0;
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.player-sports-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--secondary-color);
    font-size: 1.4rem;
}

.sport-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: background-color var(--transition-speed); /* For hover effect */
}

.sport-item:hover {
    background-color: rgba(0, 0, 0, 0.03); /* Subtle hover effect */
}

.primary-sport {
    border-left: 4px solid var(--secondary-color);
}

.sport-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sport-name {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.sport-year {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
}

.sport-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.sport-detail {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.stat-card {
    background-color: var(--background-light);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: #1a1a1a;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 90%;
    height: 90%;
    max-width: 800px;
    background-color: var(--background-light);
    border-radius: 10px;
    clip-path: inset(0 round 10px);
    position: relative;
    padding: 20px;
    display: block;
    overflow: auto;
    scrollbar-gutter: stable both-edges;
}

.close-modal-btn {
    position: sticky;
    top: 10px;
    left: unset;
    right: 10px;
    float: right;
    min-width: 40px;
    min-height: 40px;
    background-color: var(--accent-color);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
}

.trophy-modal-viewer {
    width: 100%;
    height: 100%;
}

/* Loading Spinner */
#loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    flex-direction: column;
}

.logo-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin-bottom: 20px;
}

.logo-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* The background, desaturated, and somewhat transparent version */
.logo-base {
    filter: grayscale(100%) brightness(0.7);
    opacity: 0.4;
}

/* The full-color version that will be revealed */
.logo-reveal {
    clip-path: inset(0 100% 0 0);
    animation: wipeIn 3s ease-out forwards;
}

@keyframes wipeIn {
    0% {
        clip-path: inset(0 100% 0 0);
    }
    100% {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* All Players Page */
.all-players-view .view-title {
    text-align: center;
}

#all-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Match card width */
    gap: 20px;
    padding: 20px;
}

/* Search Results Styles */
.search-results-view {
    padding: 20px;
}

.search-section {
    margin-bottom: 30px;
}

.search-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--secondary-color);
}

.no-results {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--text-light);
    text-align: center;
    padding: 15px;
}

/* Player Modal */
.player-modal {
    align-items: flex-start;
    padding-top: 50px;
}

.player-modal .modal-content {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.player-modal-content {
    width: 100%;
}

/* Responsive Styles */
@media (min-width: 900px) {
    .team-content {
        grid-template-columns: var(--awards-column-width, 300px) 1fr; /* Use CSS var, default to 300px */
        grid-template-rows: auto;
        align-items: flex-start; /* Align tops of sections */
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        padding: 12px;
        height: auto;
    }
    
    .nav-section, .title-section {
        width: 100%;
        justify-content: center;
    }
    
    .title-section {
        margin-bottom: 10px;
    }
    
    .search-container {
        position: relative;
        display: flex;
        align-items: center;
        background-color: rgba(255, 255, 255, 0.15);
        border-radius: 24px;
        padding: 0 15px;
        /* overflow: hidden; */  /* <--- MODIFIED: Commented out or deleted */
        width: 100%;
        max-width: 300px;
    }
    
    .full-width-header {
        height: 200px;
    }
    
    .category-cards {
        grid-template-columns: 1fr;
    }
    
    .player-card[data-expanded="true"] {
        min-width: 280px;
    }
    
    .sport-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sport-year {
        margin-top: 5px;
    }
    
    /* Adjust body padding for taller header */
    body {
        padding-bottom: 120px;
    }
}

@media (max-width: 480px) {
    .app-header h1 {
        font-size: 1.2rem;
    }
    
    .schools-grid,
    #all-players-grid {
        grid-template-columns: 1fr;
    }
    
    .carousel-nav {
        width: 30px;
        height: 30px;
    }
    
    .player-detail-view {
        padding: 10px;
    }
    
    .header-title {
        font-size: 1.5rem;
    }
    
    /* Adjust body padding for even taller header */
    body {
        padding-bottom: 140px;
    }
}

/* Athlete Detail View */
.athlete-detail-view {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.athlete-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.athlete-media {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden; /* Crucial for circular shape */
    flex-shrink: 0;
    background-color: var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid var(--secondary-color);
}

.athlete-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.athlete-info {
    flex: 1;
}

.athlete-name {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.athlete-graduation, 
.athlete-sport, 
.athlete-affiliation,
.athlete-detail {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #666;
}

.athlete-affiliation {
    font-weight: bold;
    color: var(--secondary-color);
}

.athlete-background {
    margin-top: 30px;
}

.athlete-background h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--secondary-color);
    font-size: 1.4rem;
}

.athlete-description {
    line-height: 1.6;
    color: #333;
}

@media (max-width: 600px) {
    .athlete-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Achievement item styling */
.achievement-item {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--secondary-color);
}

.achievement-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.achievement-description {
    color: #666;
    font-size: 0.9rem;
}

/* Player detail styling improvements */
.player-sports-section {
    margin: 30px 0;
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.player-achievements {
    margin: 30px 0;
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.player-achievements h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--secondary-color);
    font-size: 1.4rem;
}

/* Additional improvement for sport items */
.sport-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: background-color var(--transition-speed); /* For hover effect */
}

.sport-item:hover {
    background-color: rgba(0, 0, 0, 0.03); /* Subtle hover effect */
}

/* Update sport section styles to avoid dark background and make it more like the mockups */
.sport-section .horizontal-scroll-content {
    min-height: auto;
    padding-bottom: 20px; /* Add space at the bottom */
}

.sport-year-card {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Updated player card styles to better match mockups */
.player-card {
    min-width: 180px;
    height: 260px; /* Taller than wider, as in mockups */
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all var(--transition-speed);
    flex-shrink: 0;
    position: relative;
    color: var(--text-dark);
}

.player-card[data-expanded="true"] {
    min-width: 280px;
    height: 340px; /* Taller to accommodate expanded info */
    z-index: 10;
    background-color: var(--background-dark);
    color: var(--text-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.player-media {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 15px auto 10px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid var(--secondary-color);
}

.player-info {
    padding: 0 10px;
}

.player-name {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.2rem;
    text-align: center;
}

.player-number, .player-position {
    text-align: center;
}

.player-card-expanded {
    display: none; /* Hidden by default */
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.8);
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
}

.player-card[data-expanded="true"] .player-card-expanded {
    display: block; /* Show when expanded */
}

.stat-label {
    min-width: 70px;
    text-align: center;
}

.player-stats-container {
    margin-top: 15px;
}

/* Fix missing stat row/label styles */
.stat-row {
    display: flex;
    margin-bottom: 5px;
}

.stat-label {
    font-weight: bold;
    margin-right: 5px;
    color: #1a1a1a;
    min-width: 70px;
    text-align: center;
}

.stat-value {
    color: var(--text-light);
}

.player-stats-container {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.player-stat {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
}

/* For expanded player cards, change layout */
.player-card[data-expanded="true"] .player-card-compact {
    width: 45%;
    height: 100%;
    align-items: center;
    justify-content: center;
    padding-right: 0;
    padding-left: 10px;
}

.player-card[data-expanded="true"] .player-card-content {
    flex-direction: row;
}

.player-card[data-expanded="true"] .player-media {
    width: 100px;
    height: 100px;
    margin: 10px auto;
}

.player-card[data-expanded="true"] .player-card-expanded {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 15px 10px;
    width: 55%;
    background-color: var(--background-dark);
    position: relative;
}

.player-card[data-expanded="true"] .expanded-stats {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.player-card[data-expanded="true"] .player-stats-container {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-card[data-expanded="true"] .player-stat {
    text-align: center;
    padding: 6px 8px;
}

.view-full-profile {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1rem;
    transition: color var(--transition-speed);
    width: 30px;
    height: 30px;
    display: none; /* Only show when expanded */
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Player Card Overrides for Team Roster - NEW MOCKUP - SCALED DOWN v2 */
/* Applied specifically to .team-detail-view .player-card */

.team-detail-view .player-card {
  box-sizing: border-box;
  border: 1px solid #A5ACB0;
  border-radius: 5px; /* Slightly reduced radius */
  font-family: 'Source Sans Pro', sans-serif;
  transition: all var(--transition-speed);
  overflow: hidden;
  transform-origin: top left; /* Helps scaling transition */
  flex-shrink: 0; /* ENSURE CARDS DON'T SHRINK */
}

/* Compact State (Scaled Down v2) */
.team-detail-view .player-card[data-expanded="false"] {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 15px 20px; /* Reduced padding */
  gap: 10px; /* Reduced gap */
  width: 240px; /* Scaled width */
  height: 325px; /* Scaled height */
  background: #FFFFFF;
}

.team-detail-view .player-card[data-expanded="false"] .player-card-compact {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.team-detail-view .player-card[data-expanded="false"] .player-image-circular {
  width: 160px; /* Scaled image */
  height: 160px; /* Scaled image */
  /* background-size: cover; */ /* Not needed if using actual img/video */
  /* background-position: center; */ /* Not needed if using actual img/video */
  border-radius: 50%;
  margin-bottom: 10px;
  overflow: hidden; /* Ensure this is present for the circular shape */
  display: flex; /* To help center fallback SVG */
  justify-content: center;
  align-items: center;
  background-color: var(--accent-color); /* Fallback background */
}

.team-detail-view .player-card[data-expanded="false"] .player-text-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
}

.team-detail-view .player-card[data-expanded="false"] .player-name {
  width: 100%;
  font-family: 'Oswald', sans-serif;
  font-style: normal;
  font-weight: 500;
  font-size: 22px; /* Scaled font */
  line-height: 1.3;
  text-align: center;
  color: #000000;
}

.team-detail-view .player-card[data-expanded="false"] .player-sub-details {
  width: 100%;
  font-family: 'Source Sans Pro', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 15px; /* Scaled font */
  line-height: 1.3;
  text-align: center;
  color: #666;
}

/* Hide expanded view when card is compact */
.team-detail-view .player-card[data-expanded="false"] .player-card-expanded {
  display: none;
}

/* Expanded State (Scaled Down v2) */
.team-detail-view .player-card[data-expanded="true"] {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 15px 20px; /* Reduced padding */
  gap: 20px; /* Reduced gap */
  width: 510px; /* Scaled width */
  height: 325px; /* Match scaled compact height */
  background: #384656;
  border-color: #384656;
}

.team-detail-view .player-card[data-expanded="true"] .player-card-expanded {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px; /* Reduced gap */
    width: 100%;
    height: 100%;
    background-color: transparent; /* Ensure no inner background */
}

/* Hide compact view when card is expanded */
.team-detail-view .player-card[data-expanded="true"] .player-card-compact {
  display: none;
}

.team-detail-view .player-card[data-expanded="true"] .player-image-rectangular {
  width: 170px; /* Scaled image width */
  height: 250px; /* Scaled image height */
  /* background-size: cover; */ /* Not needed if using actual img/video */
  /* background-position: center; */ /* Not needed if using actual img/video */
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden; /* Ensure this is present for the rectangular shape and object-fit */
  display: flex; /* To help center fallback SVG */
  justify-content: center;
  align-items: center;
  background-color: #ccc; /* Fallback background */
}

.team-detail-view .player-card[data-expanded="true"] .player-info-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0px;
  height: 250px; /* Match image height */
  flex-grow: 1;
  background-color: transparent; /* Ensure no inner background */
}

.team-detail-view .player-card[data-expanded="true"] .info-header-container {
  display: flex;
  flex-direction: column;
  align-items: center; 
  padding: 0px 0px 10px; /* Reduced padding */
  width: 100%;
  margin: 0 auto;
  border-bottom: 1px solid #BE9F60;
}

.team-detail-view .player-card[data-expanded="true"] .info-header-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0px;
  width: 100%;
  height: auto;
}

.team-detail-view .player-card[data-expanded="true"] .name-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0px;
  flex-shrink: 0;
}

.team-detail-view .player-card[data-expanded="true"] .name-section .first-name {
  font-family: 'Oswald', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 22px; /* Scaled font */
  line-height: 1.2;
  display: flex;
  align-items: center;
  color: #FFFFFF;
}

.team-detail-view .player-card[data-expanded="true"] .name-section .last-name {
  font-family: 'Oswald', sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 26px; /* Scaled font */
  line-height: 1.1;
  display: flex;
  align-items: center;
  text-transform: uppercase;
  color: #FFFFFF;
}

.team-detail-view .player-card[data-expanded="true"] .jersey-number {
  font-family: 'Oswald', sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 24px; /* Scaled font */
  line-height: 1.4;
  display: flex;
  align-items: center;
  text-transform: uppercase;
  color: #BE9F60;
  flex-shrink: 0;
}

.team-detail-view .player-card[data-expanded="true"] .details-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0px;
  gap: 6px; /* Reduced gap */
  width: 100%;
}

.team-detail-view .player-card[data-expanded="true"] .detail-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0px;
  gap: 15px; /* Reduced gap */
  width: 100%;
}

.team-detail-view .player-card[data-expanded="true"] .detail-item .detail-label {
  width: 80px; /* Scaled width */
  font-family: 'Source Sans Pro', sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 13px; /* Scaled font */
  line-height: 1.4;
  display: flex;
  align-items: center;
  text-transform: uppercase;
  color: #FFFFFF;
  flex-shrink: 0;
}

.team-detail-view .player-card[data-expanded="true"] .detail-item .detail-value {
  font-family: 'Source Sans Pro', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 13px; /* Scaled font */
  line-height: 1.4;
  display: flex;
  align-items: center;
  text-transform: uppercase;
  color: #FFFFFF;
}

.team-detail-view .player-card[data-expanded="true"] .statistics-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0px;
  gap: 6px; /* Reduced gap */
  width: 100%;
}

.team-detail-view .player-card[data-expanded="true"] .statistics-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0px;
  width: 100%;
  height: auto;
  border-width: 1px 0px;
  border-style: solid;
  border-color: #BE9F60;
  margin-bottom: 4px;
  padding: 1px 0;
}

.team-detail-view .player-card[data-expanded="true"] .statistics-title {
  font-family: 'Oswald', sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 16px; /* Scaled font */
  line-height: 1.4;
  display: flex;
  align-items: center;
  text-transform: uppercase;
  color: #FFFFFF;
}

.team-detail-view .player-card[data-expanded="true"] .stats-layout {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0px;
  gap: 6px; /* Reduced gap */
  width: 100%;
}

.team-detail-view .player-card[data-expanded="true"] .stat-box {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3px 0;
  gap: 3px;
  height: 60px; /* Scaled height */
  border: 1px solid #A5ACB0;
  border-radius: 3px;
  flex-grow: 1;
  flex-basis: 0;
  text-align: center;
}

.team-detail-view .player-card[data-expanded="true"] .stat-box .stat-label {
  font-family: 'Source Sans Pro', sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 12px; /* Scaled font */
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  color: #FFFFFF;
  width: 100%;
}

.team-detail-view .player-card[data-expanded="true"] .stat-box .stat-value {
  font-family: 'Oswald', sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 22px; /* Scaled font */
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  color: #FFFFFF;
  width: 100%;
}

/* Remove previous roster card specific styles to avoid conflicts */
/* (Selectively comment out or delete the old .team-detail-view .player-card block) */
/* For example, if the old block started at line 1561, it would be removed. */
/* This step is crucial and done by reviewing the diff or CSS structure. */

/* Ensure the new styles take precedence */
.team-detail-view .roster-section .horizontal-scroll-content {
    align-items: flex-start; /* Align cards to the top */
}

/* Overrides for All Players View */
.all-players-view .player-card {
  width: 280px; /* Adjust width as needed */
  height: auto; /* Adjust height based on content */
  min-height: 180px;
  padding: 20px;
  background: #FFFFFF;
  border: 1px solid #E0E0E0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  display: flex; /* Use flex for centering */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

/* Make compact view visible and centered */
.all-players-view .player-card .player-card-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  gap: 5px; /* MODIFIED - Reduced from 15px */
}

/* Style the circular image */
.all-players-view .player-card .player-image-circular {
  width: 100px; /* MODIFIED - Increased from 80px */
  height: 100px; /* MODIFIED - Increased from 80px */
  border-radius: 50%;
  /* background-size: cover; */ /* Not needed */
  /* background-position: center; */ /* Not needed */
  background-color: var(--accent-color); /* Fallback background */
  margin-bottom: 0px; /* MODIFIED - Was 10px */
  border: 2px solid var(--secondary-color); /* Optional border */
  overflow: hidden; /* Crucial for shape */
  display: flex; /* For centering SVG */
  justify-content: center;
  align-items: center;
}

/* Center text info */
.all-players-view .player-card .player-text-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  width: 100%;
}

.all-players-view .player-card .player-name {
  font-family: 'Oswald', sans-serif; /* Match font */
  font-weight: 600;
  font-size: 1.25rem; /* Adjust size */
  color: #333;
  line-height: 1.3;
}

.all-players-view .player-card .player-sub-details {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.9rem; /* Adjust size */
  color: #666;
  line-height: 1.4;
}

/* Ensure expanded part is hidden in this view */
.all-players-view .player-card .player-card-expanded {
    display: none;
}

/* Ensure the grid layout for the all-players page */
#all-players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Match card width */
    gap: 20px;
    padding: 20px;
}

/* Styles for athlete cards specifically on D1/Pro athlete list pages */
.athletes-list-view .athlete-card {
    height: 300px; /* Increased from 250px */
    width: 300px; /* Increased from 240px for more text space */
    min-width: 300px; /* Ensure min-width matches fixed width */
    display: flex; /* To help with internal alignment if needed */
    flex-direction: column;
}

.athletes-list-view .athlete-card .athlete-info {
    /* Ensure it can accommodate the new text */
    justify-content: center; /* Center content vertically if space allows */
    flex-grow: 1; /* Allow info to take available space */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent children from breaking layout */
}

.athletes-list-view .athlete-card .athlete-name {
    display: block; /* Required for text-overflow */
    width: 100%; /* Required for text-overflow */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px; /* Keep existing margin */
}

.athletes-list-view .athlete-card .athlete-affiliation-info {
    display: block; /* Required for text-overflow */
    width: 100%; /* Required for text-overflow */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: bold; /* To make it stand out a bit */
    margin-top: 8px;
    margin-bottom: 0; /* No extra space at the very bottom of info block */
    text-align: center; /* Matches other info */
    line-height: 1.3; /* Allow for wrapping - though nowrap will prevent it */
    /* word-wrap: break-word; no longer needed due to nowrap and ellipsis */
}

.awards-section .horizontal-scroll-content {
    align-items: flex-start; /* Align items to the top */
    /* min-height will be dictated by award-item height + padding */
}

.award-item {
    min-width: 200px; /* Target width for ~1.5 items in a 300px column */
    max-width: 240px; /* Optional: Prevent items from becoming too wide */
    height: 325px;    /* Consistent height */
    background-color: var(--background-light);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    flex-shrink: 0;
    position: relative; /* Good for positioning potential placeholder text if ever needed */
    font-size: 0.8rem; /* For any potential text if content fails to load */
    color: var(--text-dark);
    cursor: pointer; /* Add cursor pointer to all award items */
}

/* New styles for award item content overlay */
.award-item-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: white;
    z-index: 3; /* Above image/video/iframe overlay */
}

.award-item-title {
    color: var(--text-light);
    margin: 0;
    font-size: 1rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.award-item img,
.award-item video {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    border-radius: 0; /* Image/video takes full space of rounded parent */
}

.award-item video {
    pointer-events: none; /* Ensure non-interactivity for video */
}

.award-item iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0; /* Iframe takes full space of rounded parent */
}

/* Wrapper for iframe in card to position overlay correctly */
.award-iframe-card-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.award-iframe-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent; /* To capture clicks */
    z-index: 2; /* Ensures it's above the iframe */
    cursor: pointer;
    display: flex; /* To allow positioning of child .award-item-content */
    flex-direction: column;
    justify-content: flex-end; /* Position content at the bottom */
}

/* Styles for the generic award modal */
.generic-award-modal .modal-content {
    display: flex; /* Use flex to manage header and content */
    flex-direction: column;
    width: 90%;
    max-width: 800px; /* Or your preferred max width */
    height: 80vh;     /* Or your preferred height */
    padding: 0;       /* Remove padding if close button is absolutely positioned inside */
    background-color: var(--background-light); /* Match other modals */
    position: relative; /* For absolute positioning of close button */
}

.generic-award-modal .close-modal-btn {
    /* Re-style if needed, or ensure it's correctly positioned */
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1001; /* Above modal content */
}

.generic-award-modal .award-modal-content-wrapper {
    width: 100%;
    flex-grow: 1; /* Takes remaining height */
    overflow: auto; /* Changed from hidden to auto to allow scrolling for tall content */
    padding: 20px; /* Add padding around the content */
    box-sizing: border-box;
    display: flex;
    flex-direction: column; /* Stack title and media */
}

.award-modal-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.award-modal-media { /* For img and video in modal */
    max-width: 100%;
    max-height: calc(100% - 50px); /* Adjust based on title height and padding */
    object-fit: contain; /* Show full image/video without cropping */
    display: block;
    margin: 0 auto; /* Center the media */
    border-radius: 4px;
}

.generic-award-modal .award-modal-content-wrapper iframe.award-modal-iframe {
    width: 100%;
    height: calc(100% - 50px); /* Adjust based on title height */
    border: none;
    flex-grow: 1; /* Allow iframe to take available space */
}

/* Styles for the container of dynamically inserted media elements */
.media-element-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Important for border-radius and object-fit */
}

/* Common styles for dynamically inserted img/video */
.media-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; /* Removes extra space below element */
}

.loading-message {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
    margin-top: 20px;
}