/**
 * San Antonio Cubs Baseball Website
 * Sports-Focused Theme
 * 
 * Colors: Navy (#0a1628), Cubs Blue (#0e3386), Gold (#c8a415), White, Light Gray
 */

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
    --navy: #0a1628;
    --navy-light: #132040;
    --cubs-blue: #0e3386;
    --cubs-blue-light: #1a4bba;
    --gold: #c8a415;
    --gold-light: #e6c633;
    --success-green: #28a745;
    --danger-red: #dc3545;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-700: #495057;
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

/* ============================================================
   BASE STYLES
   ============================================================ */
body {
    font-family: var(--font-body);
    background-color: var(--gray-100);
    color: #212529;
}

h1, h2, h3, h4, h5, h6,
.brand-text,
.stat-value,
.score-big {
    font-family: var(--font-heading);
}

a {
    color: var(--cubs-blue);
}

a:hover {
    color: var(--cubs-blue-light);
}

/* ============================================================
   NAVBAR
   ============================================================ */
.bg-dark-navy {
    background-color: var(--navy) !important;
}

.navbar {
    padding: 0.5rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar .brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
}

.navbar .nav-link {
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 0.8rem 1rem;
    transition: color 0.2s;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--gold) !important;
}

.dropdown-menu-dark {
    background-color: var(--navy-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-menu-dark .dropdown-item:hover {
    background-color: var(--cubs-blue);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--cubs-blue) 100%);
    color: #fff;
    padding: 3rem 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/assets/images/hero-pattern.png') repeat;
    opacity: 0.05;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero .lead {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* ============================================================
   SCORE CARDS
   ============================================================ */
.score-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.score-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.score-card-header {
    background: var(--navy);
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-card-body {
    padding: 1rem;
}

.score-big {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.score-team {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
}

.score-vs {
    color: var(--gray-700);
    font-size: 0.85rem;
    padding: 0 0.5rem;
}

/* Win/Loss indicators */
.score-win { color: var(--success-green); }
.score-loss { color: var(--danger-red); }

/* ============================================================
   STAT CARDS & TABLES
   ============================================================ */
.stat-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--cubs-blue);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-700);
    margin-top: 0.25rem;
}

/* Stats tables */
.stats-table {
    font-size: 0.85rem;
}

.stats-table thead {
    background: var(--navy);
    color: #fff;
}

.stats-table thead th {
    font-family: var(--font-heading);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 0.6rem 0.4rem;
    white-space: nowrap;
    border: none;
}

.stats-table tbody tr:nth-child(even) {
    background-color: rgba(14, 51, 134, 0.03);
}

.stats-table tbody tr:hover {
    background-color: rgba(14, 51, 134, 0.08);
}

.stats-table td {
    padding: 0.5rem 0.4rem;
    vertical-align: middle;
    white-space: nowrap;
}

.stats-table .player-name {
    font-weight: 600;
    white-space: nowrap;
}

.stats-table .player-name a {
    text-decoration: none;
    color: var(--cubs-blue);
}

.stats-table .player-name a:hover {
    text-decoration: underline;
}

/* Sortable headers */
.stats-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.stats-table th.sortable:hover {
    background: var(--cubs-blue);
}

.stats-table th.sorted-asc::after {
    content: ' \25B2';
    font-size: 0.6rem;
}

.stats-table th.sorted-desc::after {
    content: ' \25BC';
    font-size: 0.6rem;
}

/* ============================================================
   GAME COUNTDOWN / NEXT GAME
   ============================================================ */
.next-game {
    background: linear-gradient(135deg, var(--cubs-blue) 0%, var(--navy) 100%);
    color: #fff;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
}

.next-game h3 {
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 2px;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.next-game .matchup {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
}

.next-game .game-details {
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ============================================================
   LEADERS / LEADERBOARD
   ============================================================ */
.leader-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.leader-card-header {
    background: var(--navy);
    color: var(--gold);
    padding: 0.75rem 1rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.leader-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.leader-item:last-child {
    border-bottom: none;
}

.leader-rank {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-700);
    width: 2rem;
    text-align: center;
}

.leader-rank.rank-1 { color: var(--gold); }
.leader-rank.rank-2 { color: #aaa; }
.leader-rank.rank-3 { color: #cd7f32; }

.leader-name {
    flex-grow: 1;
    font-weight: 500;
    padding: 0 0.75rem;
}

.leader-value {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--cubs-blue);
}

/* ============================================================
   STANDINGS TABLE
   ============================================================ */
.standings-table {
    font-size: 0.9rem;
}

.standings-table thead {
    background: var(--navy);
    color: #fff;
}

.standings-table .team-name {
    font-weight: 600;
}

.standings-table .team-name.my-team {
    color: var(--cubs-blue);
}

/* ============================================================
   PLAYER CARDS (ROSTER)
   ============================================================ */
.player-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: transform 0.2s;
    text-align: center;
    padding: 1.5rem 1rem;
}

.player-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.player-card .jersey-number {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--cubs-blue);
    line-height: 1;
}

.player-card .player-name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

.player-card .player-position {
    font-size: 0.8rem;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================================
   NEWS / POSTS
   ============================================================ */
.post-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.post-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.post-card .post-date {
    font-size: 0.8rem;
    color: var(--gray-700);
}

/* ============================================================
   PHOTO GALLERY
   ============================================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item .caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    padding: 2rem 1rem 0.75rem;
    font-size: 0.85rem;
}

/* ============================================================
   SCHEDULE LIST
   ============================================================ */
.schedule-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

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

.schedule-date {
    width: 100px;
    font-weight: 600;
    font-size: 0.85rem;
}

.schedule-matchup {
    flex-grow: 1;
    font-weight: 500;
}

.schedule-score {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
}

/* ============================================================
   BADGES & LABELS
   ============================================================ */
.badge {
    font-family: var(--font-heading);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.badge-win {
    background-color: var(--success-green);
}

.badge-loss {
    background-color: var(--danger-red);
}

.badge-tie {
    background-color: var(--gray-700);
}

/* ============================================================
   FORMS (ADMIN)
   ============================================================ */
.form-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cubs-blue);
    border-bottom: 2px solid var(--gold);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.btn-primary {
    background-color: var(--cubs-blue);
    border-color: var(--cubs-blue);
}

.btn-primary:hover {
    background-color: var(--cubs-blue-light);
    border-color: var(--cubs-blue-light);
}

.btn-gold {
    background-color: var(--gold);
    border-color: var(--gold);
    color: var(--navy);
    font-weight: 600;
}

.btn-gold:hover {
    background-color: var(--gold-light);
    border-color: var(--gold-light);
    color: var(--navy);
}

/* ============================================================
   PAGE HEADERS
   ============================================================ */
.page-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--cubs-blue) 100%);
    color: #fff;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
}

.page-header .breadcrumb {
    margin: 0;
    padding: 0;
}

.page-header .breadcrumb-item,
.page-header .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.page-header .breadcrumb-item.active {
    color: var(--gold);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: var(--navy) !important;
    border-top: 3px solid var(--gold);
}

.footer-text {
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.7;
}

.footer-link {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-block;
    padding: 0.15rem 0;
}

.footer-link:hover {
    color: var(--gold);
}

.footer a:hover {
    color: var(--gold) !important;
}

/* ============================================================
   TEAM PHOTO BANNER
   ============================================================ */
.team-banner {
    position: relative;
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.team-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
}

.team-banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(10, 22, 40, 0.85));
    padding: 3rem 0 1.5rem;
    text-align: center;
    color: #fff;
}

.team-banner-overlay h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
}

.team-banner-overlay p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0.25rem 0 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .team-banner {
        max-height: 250px;
    }
    
    .team-banner-overlay h1 {
        font-size: 1.6rem;
    }
    
    .team-banner-overlay p {
        font-size: 0.9rem;
    }
    
    .stats-table {
        font-size: 0.75rem;
    }
    
    .stats-table td,
    .stats-table th {
        padding: 0.4rem 0.25rem;
    }
    
    .score-big {
        font-size: 2rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .navbar .brand-text {
        font-size: 1.2rem;
    }
    
    .stats-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-gold { color: var(--gold); }
.text-navy { color: var(--navy); }
.text-cubs-blue { color: var(--cubs-blue); }
.bg-navy { background-color: var(--navy); }
.bg-cubs-blue { background-color: var(--cubs-blue); }
.section-title {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--navy);
    margin-bottom: 1.5rem;
}

/* Alert messages */
.alert-dismissible {
    border-radius: 8px;
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
