@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');
/* ==========================================================================
   SCBA COACH'S CORNER - FINAL DEFINITIVE MASTER STYLES (v3.2)
   ========================================================================== */

/* GLOBAL IMAGE SAFETY RESET */
img {
    max-width: 100% !important;
    height: auto;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
	background-image: url('https://firebasestorage.googleapis.com/v0/b/scba-coach-s-corner.firebasestorage.app/o/background3.png?alt=media&token=1902243a-9965-4db9-b03d-7674c37e8490');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    font-size: 0.95em;
    background-color: #f5f5f5;
}

/* THE MASTER CENTERING RULE */
/* Fixed: Removed display: block !important so grids can function properly */
.page-wrapper, 
.rules-grid, 
.rule-categories-grid, 
.hub-container-listing, 
.form-container, 
.log-container,
.container {
    width: 100% !important;
    max-width: 900px !important;
    margin: 0 auto !important;
}

.page-wrapper { display: block; padding: 24px 15px 40px 15px; margin-top: 20px; }
.rules-grid, .rule-categories-grid { padding: 0 10px; margin-top: 30px !important; margin-bottom: 30px !important; }

/* --- TYPOGRAPHY --- */
h1 {
    color: #003087;
    text-align: center;
    margin: 30px 0 15px 0;
    font-size: 3.5rem;
    text-shadow: 2px 2px 0px #fff, 4px 4px 10px rgba(0,0,0,0.1);
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1;
}

h2, h3 { color: #0056b3; text-align: center; margin: 15px 0 10px 0; }

/* --- NAVIGATION --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333;
    padding: 0 20px;
    height: 50px;
    position: sticky;
    top: 0;
    z-index: 9999;
}
.nav-brand .nav-logo { 
    height: 40px !important; 
    width: auto !important;
    max-width: 150px !important;
    max-height: 40px !important;
    object-fit: contain;
}
.nav-links { display: flex; gap: 15px; align-items: center; }
.nav-links a { color: white; text-decoration: none; font-size: 0.9rem; font-weight: 500; padding: 8px 12px; transition: all 0.2s ease; }
#navAddTeamsLink, [id^="navExport"] { color: #ffc107 !important; border: 1px solid rgba(255, 193, 7, 0.3); border-radius: 4px; }
.logout-link { color: #ff4d4d !important; }

/* --- GRID COMPONENTS --- */
.rules-grid, .rule-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
}

.rule-card, .rule-category-card {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    border-top: 4px solid #007bff;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1; /* Make them square! */
    box-sizing: border-box;
}
.rule-card:hover, .rule-category-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }

.rule-card h3, .rule-category-card h3 {
    font-size: 1rem;
    margin: 0;
    font-weight: 700;
}
.rule-card p, .rule-category-card p {
    font-size: 0.8rem;
    margin: 0;
    line-height: 1.35;
}

/* Rules Details */
.rules-page-h1 { color: #fff; margin-bottom: 5px; }
.acc-btn { background-color: #004488; color: white; padding: 16px; width: 100%; border: none; border-radius: 6px; font-weight: bold; display: flex; justify-content: space-between; margin-top: 8px; cursor: pointer; }
.acc-btn:after { content: '\002B'; font-size: 18px; }
.acc-btn.active:after { content: "\2212"; }
.panel { padding: 0 18px; display: none; background: #fff; border-left: 4px solid #004488; }
.rules-table { width: 100%; border-collapse: collapse; margin: 15px 0; }
.rules-table td { padding: 12px; border-bottom: 1px solid #eee; }
.rules-table td:first-child { font-weight: bold; color: #004488; width: 45%; }
.warning-box { background: #fffdf5; color: #856404; padding: 12px; border-radius: 4px; border-left: 4px solid #ffc107; font-size: 0.9em; margin: 15px 0; }
.summary-card { background: #fdfdfd; border: 1px solid #eee; border-radius: 8px; padding: 20px; margin-bottom: 25px; }
.btn-pdf { display: block; width: 100%; padding: 12px; text-align: center; background: #cc0000; color: white; text-decoration: none; border-radius: 6px; font-weight: bold; margin-bottom: 20px; }

/* --- COMMUNITY HUB & SCHEDULE --- */
.community-header {
    padding: 26px;
    border-radius: 22px;
    margin-bottom: 30px;
    border: 1px solid #e3e6ea;
    background: #ffffff;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 22px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.08);
}
.header-logo { 
    width: 90px !important; 
    height: 90px !important; 
    max-width: 90px !important;
    max-height: 90px !important;
    object-fit: contain; 
    mix-blend-mode: multiply; 
    flex-shrink: 0;
}
.community-header h2 { font-size: 2.4rem; margin: 0; color: #003087; font-weight: 700; letter-spacing: -0.04em; }

.community-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; padding: 10px; margin-top: 10px; }
.community-card {
    background: #ffffff;
    border-radius: 20px;
    text-decoration: none;
    color: #1f304a;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(224, 229, 239, 0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card-topbar {
    height: 4px;
    background: linear-gradient(90deg, #1f3c88 0%, #007bff 100%);
}
.card-body {
    padding: 20px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
    justify-content: center;
}
.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
}
.card-copy {
    font-size: 0.8rem;
    color: #556580;
    line-height: 1.5;
}
.community-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
    border-color: rgba(0, 123, 255, 0.22);
}
.stadium-header {
    padding: 40px 24px;
    border-radius: 28px;
    margin-bottom: 28px;
    background: linear-gradient(135deg, #f7f9fc 0%, #ffffff 100%);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(224, 229, 239, 0.9);
}
.hub-title-group {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}
.hub-overline {
    margin: 0 0 10px 0;
    font-size: 0.82rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #0072e5;
    font-weight: 700;
}
.hub-title {
    margin: 0;
    font-size: clamp(2.6rem, 4vw, 4.2rem);
    line-height: 1.05;
    color: #09225b;
    letter-spacing: -0.05em;
}
.hub-subtitle {
    margin: 18px auto 0;
    max-width: 720px;
    color: #556580;
    font-size: 1rem;
    line-height: 1.8;
}
.modern-notification {
    display: inline-flex;
    margin: 0 auto 30px auto;
    padding: 16px 28px;
    border-radius: 999px;
    border: 1px solid rgba(0, 112, 229, 0.14);
    background: rgba(255,255,255,0.96);
    color: #0f2f66;
    box-shadow: 0 14px 32px rgba(15,23,42,0.08);
}

/* Main Header Logo */
.main-header-logo {
    display: block;
    margin: 20px auto 0 auto;
    height: 120px !important;
    width: auto !important;
    max-height: 120px !important;
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* Mobile Partner Bar (Now Global Footer Bar) */
.mobile-partner-bar {
    display: block;
    background: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 12px;
    margin: 40px auto 20px auto;
    text-align: center;
    max-width: 600px;
    border: 1px solid #ddd;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.partner-label { display: block; font-size: 0.7rem; color: #0056b3; font-weight: bold; text-transform: uppercase; margin-bottom: 12px; letter-spacing: 1px; }
.partner-logos { display: flex; justify-content: center; align-items: center; gap: 25px; flex-wrap: wrap; }
.mobile-partner-img { height: 50px !important; width: auto !important; max-height: 50px !important; object-fit: contain; mix-blend-mode: multiply; }

.sponsor-scroll-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e3e6ea;
    box-shadow: 0 18px 40px rgba(0,0,0,0.08);
    padding: 20px 24px;
    margin-top: 32px;
}
.sponsor-scroll-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: #003087;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}
.sponsor-scroll-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-behavior: smooth;
}
.sponsor-scroll-track::-webkit-scrollbar {
    height: 8px;
}
.sponsor-scroll-track::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.18);
    border-radius: 999px;
}
.sponsor-logo-item {
    flex: 0 0 auto;
    min-width: 132px;
    height: 104px;
    border-radius: 18px;
    background: #f7f9fb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border: 1px solid #e8eaed;
    box-shadow: 0 10px 24px rgba(0,0,0,0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.sponsor-logo-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.12);
}
.sponsor-logo-item img {
    max-height: 70px;
    max-width: 100%;
    object-fit: contain;
}

/* --- SCHEDULE & GAME CARDS --- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; }
.game-card { background: #fff; border-radius: 8px; border: 1px solid #eee; box-shadow: 0 6px 20px rgba(0,0,0,0.1); overflow: hidden; }
.game-card-header { background: #f8f9fa; padding: 6px 12px; display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: bold; }
.game-card-body { padding: 10px 12px; }
.matchup { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.team-name { flex: 1; text-align: center; font-weight: bold; font-size: 0.9rem; }
.vs-symbol { color: #999; font-style: italic; font-size: 0.75rem; padding: 0 8px; }
.game-meta-row { display: flex; justify-content: space-between; font-size: 0.8rem; color: #666; border-top: 1px dashed #eee; padding-top: 8px; }
.badge { padding: 1px 6px; border-radius: 4px; font-size: 0.65rem; color: white; text-transform: uppercase; }
.badge-home { background: #003087; }
.badge-away { background: #6c757d; }

/* Division Accordions (Schedule Page) */
.division-acc-btn { background: #333; color: white; padding: 12px 20px; margin-top: 10px; border-radius: 8px; font-size: 1.2rem; width: 100%; text-align: left; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: bold; border: none; border-left: 8px solid #007bff; }
.division-panel { padding: 10px; display: none; background: rgba(255,255,255,0.3); border-radius: 0 0 8px 8px; border: 1px solid #ddd; border-top: none; }
.team-section { margin-bottom: 15px; background: #fff; padding: 12px; border-radius: 8px; border: 1px solid #eee; }
.team-header { color: #003087; font-size: 1.2rem; font-weight: bold; margin-bottom: 10px; padding-bottom: 5px; border-bottom: 1px solid #0056b3; display: flex; justify-content: space-between; }
.view-all-btn { background: #0056b3; color: white; border: none; padding: 4px 12px; border-radius: 15px; font-size: 0.75rem; cursor: pointer; }

/* --- FORMS & ROSTERS --- */
.content-card { background: rgba(255, 255, 255, 0.95); padding: 15px 25px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); margin: 0 auto 15px auto; width: fit-content; display: flex; flex-direction: column; gap: 15px; align-items: center; }
.selection-group label { font-size: 0.75em; font-weight: bold; text-transform: uppercase; display: block; margin-bottom: 5px; }
.selection-group select, .selection-group input { padding: 8px; border: 1px solid #ccc; border-radius: 4px; min-width: 240px; }

#playerEntriesContainer { display: flex; flex-direction: column; gap: 6px; margin-top: 20px; }
.entry-card { background: #fff; padding: 10px; border-radius: 4px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); border-left: 5px solid #007bff; margin-bottom: 10px; }
.entry-grid { display: flex; gap: 10px; align-items: flex-end; }
.input-wrap { flex: 1; display: flex; flex-direction: column; }
.input-wrap input { width: 100%; padding: 6px; border: 1px solid #ccc; border-radius: 4px; }

.form-container { background: white; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.form-container label { display: block; margin-top: 15px; font-weight: bold; }
.form-container input, .form-container select, .form-container textarea { width: 100%; padding: 10px; margin-top: 5px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.form-instruction { color: #555; font-size: 14px; line-height: 1.6; margin-bottom: 25px; padding: 15px; background-color: #eef6ff; border-left: 4px solid #0056b3; border-radius: 4px; }
.payment-box { margin-bottom: 15px; padding: 15px; background: #f9f9f9; border: 1px solid #ddd; border-radius: 4px; }
.payment-box a { display: block; margin-bottom: 8px; color: #0056b3; font-weight: bold; text-decoration: none; }

.submit-btn { margin-top: 20px; padding: 12px 20px; background: #0056b3; color: white; border: none; border-radius: 4px; cursor: pointer; transition: background 0.2s; }
.submit-btn:hover { background: #004494; }

.btn-row { display: flex; gap: 10px; padding: 12px 15px; background: rgba(255, 255, 255, 0.98); box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.2); position: fixed; bottom: 0; left: 0; right: 0; z-index: 2000; }
.btn-row button { flex: 1; height: 50px; font-weight: bold; border-radius: 8px; border: none; cursor: pointer; }
.btn-primary { background-color: #28a745 !important; color: white !important; }
.btn-secondary { background-color: #007bff !important; color: white !important; }

/* Specific Desktop Adjustments */
@media (min-width: 769px) {
    .btn-row { position: static; background: transparent; box-shadow: none; margin: 30px auto; justify-content: center; max-width: 500px; }
    .btn-row button { max-width: 200px; }
    #gameEntriesContainer { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
    #gameEntriesContainer .entry-grid { flex-direction: column; align-items: stretch; }
}

/* Tools & Admin */
#distance h1 { margin-bottom: 0.5rem; }
.subtitle { text-align: center; color: #666; margin-bottom: 25px; }
.selector-box { background: rgba(255,255,255,0.9); padding: 25px; border-radius: 12px; border: 1px solid #ddd; margin-bottom: 25px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
#distance select { padding: 10px 15px; font-size: 16px; border-radius: 50px; border: 2px solid #003087; width: 100%; max-width: 400px; height: 48px; font-weight: bold; color: #003087; }

#distanceTable { 
    width: 100%; border-collapse: collapse; margin-top: 20px; 
    background: white; border-radius: 8px; overflow: hidden; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
#distance th { background-color: #003087; color: white; padding: 15px; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; }
#distance td { padding: 12px 15px; border-bottom: 1px solid #eee; text-align: center; }
#distance tr:nth-child(even) { background: #f9f9f9; }
#distance tr:hover { background: #f1f4f8; }
.miles-val { font-weight: bold; color: #d22d2d; font-size: 1.1rem; }

.hub-container { display: flex; background: #fff; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); overflow: hidden; margin: 20px auto; min-height: 600px; }
.hub-sidebar { width: 240px; background: #f1f1f1; border-right: 1px solid #ddd; display: flex; flex-direction: column; }
.hub-sidebar .tab-button { background: none; border: none; text-align: left; padding: 15px 25px; cursor: pointer; color: #555; border-left: 4px solid transparent; }
.hub-sidebar .tab-button.active { background: #fff; color: #007bff; border-left-color: #007bff; font-weight: bold; }
.hub-main { flex: 1; padding: 30px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.admin-table { 
    width: 100%; border-collapse: collapse; background: white; 
    border-radius: 8px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.admin-table th { background: #003087; color: white; padding: 15px 10px; text-align: left; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1px; }
.admin-table td { padding: 12px 10px; border-bottom: 1px solid #eee; font-size: 0.85rem; }
.admin-table tr:nth-child(even) { background: #f9f9f9; }
.admin-table tr:hover { background: #f1f4f8; }

.log-controls { background: white; padding: 20px; border-radius: 8px; margin-bottom: 25px; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.log-content h3 { text-align: left; color: #003087; border-bottom: 2px solid #eee; padding-bottom: 10px; margin-bottom: 20px; }

/* Status Pills */
.status-pill { padding: 4px 12px; border-radius: 20px; font-size: 0.7rem; font-weight: bold; text-transform: uppercase; }
.pill-Pending { background: #fff3cd; color: #856404; }
.pill-Approved { background: #d4edda; color: #155724; }
.pill-Denied { background: #f8d7da; color: #721c24; }

.type-pill { background: #eef6ff; color: #0056b3; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; }

/* Admin Buttons */
.btn-approve { background: #28a745; color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 0.75rem; font-weight: bold; margin-right: 5px; }
.btn-deny { background: #dc3545; color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 0.75rem; font-weight: bold; }
.truncate { max-width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }

/* Floating Side Logos (No Rails) */
.side-logo-container {
    display: none; /* Hidden by default */
    position: fixed;
    top: 150px;
    width: 100px;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    z-index: 100;
}

#left-side-logos { left: calc(50% - 580px); }
#right-side-logos { right: calc(50% - 580px); }

.side-logo-img {
    width: 80px !important;
    height: auto !important;
    max-height: 80px !important;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.2s;
}
.side-logo-img:hover { transform: scale(1.1); }

@media (min-width: 1000px) {
    .side-logo-container { display: flex; }
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .page-wrapper, .rules-grid, .rule-categories-grid, .hub-container-listing, .form-container, .log-container, .container { max-width: 100% !important; padding: 0 10px; }
    .community-header h2 { font-size: 1.6rem; }
    .game-grid, .community-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .rules-grid, .rule-categories-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .btn-row { position: static; background: transparent; box-shadow: none; margin: 30px auto; }
    .entry-grid { flex-direction: column; align-items: stretch; }
    .comm-logo, .ball-icon { width: 50px !important; height: 50px !important; max-width: 50px !important; max-height: 50px !important; margin-bottom: 10px; }
    .ball-icon { font-size: 2rem; }
    .mobile-partner-bar { display: block; }
}
