/* Texas Preps Portal - Main Stylesheet
   Inspired by MaxPreps layout, cleaned up, ad-free
   Uses modern-normalize for cross-browser consistency
*/

:root {
  /* Brand colors - Texas-inspired */
  --tpp-navy: #0b2545;
  --tpp-navy-light: #13366b;
  --tpp-red: #c1272d;
  --tpp-red-light: #e03a41;
  --tpp-accent: #ffc72c;       /* Texas gold */
  --tpp-bg: #f5f6f8;
  --tpp-surface: #ffffff;
  --tpp-text: #1a1a1a;
  --tpp-text-muted: #5a6372;
  --tpp-border: #e1e4e8;
  --tpp-success: #1f7a1f;
  --tpp-danger: #c1272d;

  /* Typography */
  --tpp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
              "Helvetica Neue", Arial, sans-serif;
  --tpp-font-display: "Bebas Neue", Impact, "Arial Black", sans-serif;

  /* Spacing */
  --tpp-radius: 8px;
  --tpp-radius-sm: 4px;
  --tpp-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --tpp-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --tpp-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  /* Layout */
  --tpp-max-width: 1280px;
  --tpp-header-height: 64px;
}

* { box-sizing: border-box; }

html, body {
  font-family: var(--tpp-font);
  color: var(--tpp-text);
  background: var(--tpp-bg);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--tpp-navy); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

/* ---------- HEADER ---------- */
.tpp-header {
  background: var(--tpp-navy);
  color: #fff;
  height: var(--tpp-header-height);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--tpp-shadow);
}

.tpp-header-inner {
  max-width: var(--tpp-max-width);
  margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.tpp-logo {
  font-family: var(--tpp-font-display);
  font-size: 1.6rem;
  color: #fff;
  letter-spacing: 1px;
  text-decoration: none;
  white-space: nowrap;
}

.tpp-logo:hover { text-decoration: none; }

.tpp-logo .accent { color: var(--tpp-accent); }

.tpp-nav {
  display: flex;
  gap: 1.5rem;
  flex: 1;
}

.tpp-nav a {
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.25rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}

.tpp-nav a:hover {
  border-bottom-color: var(--tpp-accent);
  text-decoration: none;
}

.tpp-header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.tpp-search-btn,
.tpp-signin-btn {
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--tpp-radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s;
}

.tpp-search-btn:hover { background: rgba(255,255,255,0.1); }

.tpp-signin-btn {
  background: var(--tpp-red);
}

.tpp-signin-btn:hover {
  background: var(--tpp-red-light);
  text-decoration: none;
}

/* Mobile menu toggle */
.tpp-menu-toggle { display: none; }

/* ---------- MAIN LAYOUT ---------- */
.tpp-main {
  max-width: var(--tpp-max-width);
  margin: 0 auto;
  padding: 1.5rem;
  min-height: calc(100vh - var(--tpp-header-height));
}

.tpp-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .tpp-layout {
    grid-template-columns: 1fr;
  }
  .tpp-nav { display: none; }
  .tpp-menu-toggle {
    display: inline-flex;
    color: #fff;
    font-size: 1.5rem;
    padding: 0.25rem 0.5rem;
  }
}

/* ---------- CARDS ---------- */
.tpp-card {
  background: var(--tpp-surface);
  border-radius: var(--tpp-radius);
  box-shadow: var(--tpp-shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--tpp-border);
}

.tpp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.tpp-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--tpp-text);
}

/* ---------- BREADCRUMB ---------- */
.tpp-breadcrumb {
  font-size: 0.85rem;
  color: var(--tpp-text-muted);
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.tpp-breadcrumb a { color: var(--tpp-text-muted); }
.tpp-breadcrumb .sep { opacity: 0.5; }

/* ---------- SCHOOL HEADER ---------- */
.tpp-school-header {
  background: var(--tpp-navy);
  color: #fff;
  padding: 1.5rem;
  border-radius: var(--tpp-radius);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.tpp-school-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  object-fit: cover;
}

.tpp-school-name {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.tpp-school-location {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-top: 0.25rem;
}

.tpp-school-tabs {
  display: flex;
  gap: 1.5rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--tpp-border);
  margin: 1.5rem 0;
}

.tpp-school-tabs a {
  padding: 0.75rem 0.25rem;
  color: var(--tpp-text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.tpp-school-tabs a.active {
  color: var(--tpp-text);
  border-bottom-color: var(--tpp-red);
}

/* ---------- FEATURED VIDEO ---------- */
.tpp-featured-video {
  background: #000;
  border-radius: var(--tpp-radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  position: relative;
  margin-bottom: 1rem;
}

.tpp-featured-video video,
.tpp-featured-video iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tpp-video-meta {
  padding: 0.75rem 0;
}

.tpp-video-sport {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--tpp-text-muted);
}

.tpp-sport-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tpp-red);
}

.tpp-video-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0.25rem 0 0;
}

/* ---------- SPORT GRID ---------- */
.tpp-sport-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.tpp-sport-column h3 {
  font-size: 0.9rem;
  color: var(--tpp-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 0.5rem;
}

.tpp-sport-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.tpp-sport-tile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--tpp-border);
  border-radius: var(--tpp-radius-sm);
  background: var(--tpp-surface);
  font-size: 0.9rem;
  color: var(--tpp-text);
  transition: all 0.15s;
}

.tpp-sport-tile:hover {
  border-color: var(--tpp-navy);
  background: var(--tpp-bg);
  text-decoration: none;
  transform: translateY(-1px);
}

.tpp-sport-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tpp-tab-row {
  display: flex;
  background: var(--tpp-bg);
  border-radius: var(--tpp-radius-sm);
  padding: 4px;
  margin-bottom: 1rem;
}

.tpp-tab-row button {
  flex: 1;
  padding: 0.5rem;
  background: transparent;
  border-radius: var(--tpp-radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--tpp-text-muted);
  transition: all 0.15s;
}

.tpp-tab-row button.active {
  background: var(--tpp-red);
  color: #fff;
}

/* ---------- SCORES ---------- */
.tpp-score-row {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--tpp-border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.tpp-score-row:last-child { border-bottom: 0; }

.tpp-score-teams {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tpp-score-team {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.tpp-score-team .record {
  color: var(--tpp-text-muted);
  font-size: 0.8rem;
}

.tpp-score-team .points {
  margin-left: auto;
  font-weight: 700;
}

.tpp-score-status {
  font-size: 0.8rem;
  color: var(--tpp-text-muted);
  text-align: right;
}

.tpp-score-status.final { font-weight: 700; color: var(--tpp-text); }
.tpp-score-status.live {
  font-weight: 700;
  color: var(--tpp-red);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ---------- SIDEBAR ---------- */
.tpp-sidebar .tpp-card {
  padding: 1.25rem;
}

.tpp-map {
  width: 100%;
  height: 160px;
  border-radius: var(--tpp-radius-sm);
  background: var(--tpp-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect fill='%23e1e4e8' width='100' height='100'/%3E%3Ctext x='50' y='50' text-anchor='middle' fill='%235a6372' font-size='8'%3EMap loading...%3C/text%3E%3C/svg%3E") center/cover;
  border: 1px solid var(--tpp-border);
  margin-bottom: 1rem;
}

.tpp-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tpp-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.6rem 0.4rem;
  border: 1px solid var(--tpp-border);
  border-radius: var(--tpp-radius-sm);
  color: var(--tpp-text);
  font-size: 0.8rem;
  background: var(--tpp-surface);
  transition: all 0.15s;
}

.tpp-action-btn:hover {
  background: var(--tpp-bg);
  text-decoration: none;
  border-color: var(--tpp-navy);
}

.tpp-info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--tpp-border);
}

.tpp-info-row:last-child { border-bottom: 0; }
.tpp-info-label { color: var(--tpp-text-muted); }
.tpp-info-value { font-weight: 600; }

.tpp-color-dots {
  display: flex;
  gap: 0.25rem;
}

.tpp-color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
}

/* ---------- UPCOMING EVENTS GRID ---------- */
.tpp-events-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.tpp-event-tile {
  background: var(--tpp-surface);
  border: 1px solid var(--tpp-border);
  border-radius: var(--tpp-radius);
  overflow: hidden;
}

.tpp-event-banner {
  padding: 0.75rem;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--tpp-navy), var(--tpp-navy-light));
}

.tpp-event-banner.soccer { background: linear-gradient(135deg, #1a6b1a, #2e8b2e); }
.tpp-event-banner.volleyball { background: linear-gradient(135deg, #6b1a6b, #8b2e8b); }
.tpp-event-banner.baseball { background: linear-gradient(135deg, #1a4b6b, #2e6b8b); }
.tpp-event-banner.lacrosse { background: linear-gradient(135deg, #2e4b1a, #4b6b2e); }

.tpp-event-body {
  padding: 0.75rem;
  font-size: 0.85rem;
}

.tpp-event-cta {
  display: block;
  background: var(--tpp-red);
  color: #fff;
  text-align: center;
  padding: 0.5rem;
  border-radius: var(--tpp-radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.tpp-event-cta:hover { background: var(--tpp-red-light); text-decoration: none; }

.tpp-event-time {
  color: var(--tpp-text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.tpp-event-teams {
  font-size: 0.8rem;
  color: var(--tpp-text);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ---------- TRENDING ARTICLES (Home page) ---------- */
.tpp-hero {
  background: linear-gradient(135deg, var(--tpp-navy), var(--tpp-navy-light));
  color: #fff;
  padding: 3rem 1.5rem;
  text-align: center;
  border-radius: var(--tpp-radius);
  margin-bottom: 2rem;
}

.tpp-hero h1 {
  font-family: var(--tpp-font-display);
  font-size: 2.75rem;
  margin: 0 0 0.5rem;
  letter-spacing: 1px;
}

.tpp-hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin: 0 0 1.5rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.tpp-hero-cta {
  display: inline-block;
  background: var(--tpp-accent);
  color: var(--tpp-navy);
  padding: 0.85rem 2rem;
  border-radius: var(--tpp-radius-sm);
  font-weight: 700;
  font-size: 1rem;
}

.tpp-hero-cta:hover { filter: brightness(0.95); text-decoration: none; }

.tpp-trending {
  margin-bottom: 2rem;
}

.tpp-trending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.tpp-article-card {
  background: var(--tpp-surface);
  border: 1px solid var(--tpp-border);
  border-radius: var(--tpp-radius);
  overflow: hidden;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.tpp-article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--tpp-shadow-lg);
  text-decoration: none;
}

.tpp-article-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--tpp-navy), var(--tpp-red));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.tpp-article-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tpp-article-meta {
  font-size: 0.8rem;
  color: var(--tpp-text-muted);
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tpp-article-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tpp-text);
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.tpp-article-excerpt {
  font-size: 0.9rem;
  color: var(--tpp-text-muted);
  margin: 0;
  flex: 1;
}

.tpp-article-sport-tag {
  display: inline-block;
  background: var(--tpp-bg);
  color: var(--tpp-text);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.75rem;
  width: fit-content;
}

/* ---------- BUTTONS ---------- */
.tpp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--tpp-radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
  text-decoration: none;
}

.tpp-btn-primary {
  background: var(--tpp-red);
  color: #fff;
}

.tpp-btn-primary:hover {
  background: var(--tpp-red-light);
  text-decoration: none;
}

.tpp-btn-secondary {
  background: var(--tpp-surface);
  color: var(--tpp-navy);
  border-color: var(--tpp-border);
}

.tpp-btn-secondary:hover {
  background: var(--tpp-bg);
  text-decoration: none;
}

.tpp-btn-block { width: 100%; }

/* ---------- FORMS ---------- */
.tpp-form-group { margin-bottom: 1rem; }

.tpp-form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--tpp-text);
}

.tpp-form-input,
.tpp-form-select,
.tpp-form-textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--tpp-border);
  border-radius: var(--tpp-radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--tpp-surface);
  transition: border-color 0.15s;
}

.tpp-form-input:focus,
.tpp-form-select:focus,
.tpp-form-textarea:focus {
  outline: none;
  border-color: var(--tpp-navy);
  box-shadow: 0 0 0 3px rgba(11, 37, 69, 0.1);
}

/* ---------- FOOTER ---------- */
.tpp-footer {
  background: var(--tpp-navy);
  color: #fff;
  padding: 2.5rem 1.5rem;
  margin-top: 3rem;
}

.tpp-footer-inner {
  max-width: var(--tpp-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

.tpp-footer h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--tpp-accent);
  margin: 0 0 0.75rem;
}

.tpp-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tpp-footer li { margin-bottom: 0.4rem; }
.tpp-footer a { color: #fff; opacity: 0.85; font-size: 0.9rem; }
.tpp-footer a:hover { opacity: 1; }

.tpp-footer-bottom {
  max-width: var(--tpp-max-width);
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.85rem;
  opacity: 0.75;
  text-align: center;
}

@media (max-width: 720px) {
  .tpp-footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .tpp-sport-list {
    grid-template-columns: 1fr;
  }
  .tpp-events-grid {
    grid-template-columns: 1fr;
  }
  .tpp-hero h1 { font-size: 2rem; }
  .tpp-school-name { font-size: 1.35rem; }
}

/* ---------- UTILITY ---------- */
.tpp-hidden { display: none !important; }
.tpp-sr { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.tpp-flex { display: flex; gap: 0.5rem; align-items: center; }
.tpp-muted { color: var(--tpp-text-muted); }
.tpp-text-sm { font-size: 0.85rem; }
.tpp-text-lg { font-size: 1.1rem; }
.tpp-bold { font-weight: 700; }
.tpp-mt-1 { margin-top: 0.5rem; }
.tpp-mt-2 { margin-top: 1rem; }
.tpp-mt-3 { margin-top: 1.5rem; }

/* Loading spinner */
.tpp-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--tpp-border);
  border-top-color: var(--tpp-navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
