/**
 * yam.tf - TF2 UI Components, Controls & Modals
 */

/* ==========================================================================
   Header Bar
   ========================================================================== */

.site-header {
  background-color: var(--color-bg-header);
  border-bottom: 2px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: block;
  transition: transform var(--transition-fast), filter var(--transition-fast);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}

.brand-link:hover .brand-logo {
  transform: scale(1.08) rotate(3deg);
  filter: drop-shadow(0 0 10px rgba(231, 181, 59, 0.4));
}

.brand-title-group {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: 'Barlow Condensed', 'TF2 Build', 'Impact', sans-serif;
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--color-text-white);
  line-height: 0.95;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.brand-title .accent-tf {
  color: var(--color-tf-gold);
  text-shadow: 0 0 10px rgba(231, 181, 59, 0.45);
}

.brand-title .accent-blu {
  color: var(--color-tf-blu-hover);
}

.brand-title .accent-red {
  color: var(--color-tf-red-hover);
}

.brand-tagline {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-top: 3px;
}

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

/* ==========================================================================
   Universal Section Header Bars & Breadcrumbs
   ========================================================================== */

.section-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  scroll-margin-top: 78px;
}

.section-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  flex-wrap: wrap;
}

.section-breadcrumbs a {
  color: var(--color-tf-gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.section-breadcrumbs a:hover {
  color: var(--color-text-white);
  text-decoration: underline;
}

.section-breadcrumbs .crumb-sep {
  color: var(--color-border);
}

.section-breadcrumbs .current-crumb {
  color: var(--color-text-primary);
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ==========================================================================
   TF2 Live Beacon & Badges
   ========================================================================== */

.beacon-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background-color: var(--color-online-bg);
  border: 1px solid var(--color-online);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-xs);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #79d668;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 0 8px rgba(88, 151, 67, 0.25);
}

.beacon-pill.beacon-offline {
  background-color: var(--color-offline-bg);
  border-color: var(--color-offline);
  color: #f87171;
  box-shadow: none;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #79d668;
  box-shadow: 0 0 6px #79d668;
  animation: pulseBeacon 2s infinite ease-in-out;
}

@keyframes pulseBeacon {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.beacon-offline .pulse-dot {
  background-color: #f87171;
  box-shadow: none;
  animation: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-xs);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-xs {
  padding: 0.1rem 0.38rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.badge-blu {
  background-color: var(--color-tf-blu-bg);
  color: #cbe6ff;
  border: 1px solid var(--color-tf-blu);
}

.badge-red {
  background-color: var(--color-tf-red-bg);
  color: #ffd4cf;
  border: 1px solid var(--color-tf-red);
}

.badge-gold {
  background-color: var(--color-tf-gold-bg);
  color: var(--color-tf-gold);
  border: 1px solid var(--color-tf-gold);
}

.badge-slate {
  background-color: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.badge-sand {
  background-color: rgba(210, 196, 170, 0.12);
  color: var(--color-tf-sand);
  border: 1px solid var(--color-border);
}

/* ==========================================================================
   3D Tactile TF2 Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  box-shadow: var(--shadow-btn-3d);
  position: relative;
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #100e0d, 0 2px 4px rgba(0, 0, 0, 0.4);
}

.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
}

.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  gap: 0.25rem;
  box-shadow: 0 2px 0 #100e0d;
}

.btn-xs:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #100e0d;
}

.btn-blu {
  background-color: var(--color-tf-blu);
  color: #ffffff;
  border-color: #3b5f77;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.btn-blu:hover {
  background-color: var(--color-tf-blu-hover);
  color: #ffffff;
  border-color: #7ab3d8;
  text-decoration: none;
  box-shadow: var(--shadow-btn-3d), 0 0 10px var(--color-tf-blu-glow);
}

.btn-red {
  background-color: var(--color-tf-red);
  color: #ffffff;
  border-color: #8c2528;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.btn-red:hover {
  background-color: var(--color-tf-red-hover);
  color: #ffffff;
  border-color: #e04b50;
  text-decoration: none;
  box-shadow: var(--shadow-btn-3d), 0 0 10px var(--color-tf-red-glow);
}

.btn-gold {
  background-color: var(--color-tf-gold);
  color: #151312;
  border-color: #bf8d1b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-gold:hover {
  background-color: var(--color-tf-gold-hover);
  color: #100e0d;
  border-color: #fae285;
  text-decoration: none;
  box-shadow: var(--shadow-btn-3d), 0 0 12px var(--color-tf-gold-glow);
}

.btn-secondary {
  background-color: var(--color-bg-elevated);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background-color: #322c26;
  border-color: var(--color-border-hover);
  color: #ffffff;
  text-decoration: none;
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text-secondary);
  border-color: var(--color-border);
  box-shadow: none;
}

.btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--color-text-primary);
  border-color: var(--color-text-muted);
  text-decoration: none;
}

.btn-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ==========================================================================
   Inputs & Dropdowns
   ========================================================================== */

.input-text {
  width: 100%;
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-xs);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow-hud-inset);
}

.input-text:focus {
  border-color: var(--color-tf-gold);
  box-shadow: 0 0 8px var(--color-tf-gold-glow), var(--shadow-hud-inset);
}

.input-text::placeholder {
  color: var(--color-text-muted);
}

.select-control {
  width: 100%;
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  border-radius: var(--radius-xs);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23e7b53b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  transition: border-color var(--transition-fast);
  box-shadow: var(--shadow-hud-inset);
}

.select-control:focus {
  border-color: var(--color-tf-gold);
  box-shadow: 0 0 8px var(--color-tf-gold-glow), var(--shadow-hud-inset);
}

/* ==========================================================================
   Modal Dialog (Roster / Telemetry / Details)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.82);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(5px);
}

.modal-card {
  background-color: var(--color-bg-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 740px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(231, 181, 59, 0.1);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

.modal-header {
  padding: 1rem 1.25rem;
  background-color: var(--color-bg-elevated);
  border-bottom: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header-hero {
  position: relative;
  min-height: 135px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 1.2rem 1.25rem 1rem;
  border-bottom: 2px solid var(--color-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 -30px 36px rgba(0, 0, 0, 0.85);
}

.modal-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.modal-hero-badges {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

.modal-hero-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.55rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95), 0 1px 3px rgba(0, 0, 0, 0.9);
  margin-top: 0.75rem;
  line-height: 1.15;
  letter-spacing: 0.03em;
}

.modal-close {
  background: rgba(18, 17, 16, 0.75);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(184, 56, 59, 0.85);
  color: #ffffff;
  border-color: var(--color-tf-red);
  transform: scale(1.08);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-footer {
  padding: 0.75rem 1.25rem;
  background-color: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.roster-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  background-color: var(--color-bg-main);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: 0.75rem;
  box-shadow: var(--shadow-hud-inset);
}

.roster-meta-item {
  display: flex;
  flex-direction: column;
}

.roster-meta-item .lbl {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

.roster-meta-item .val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-top: 2px;
}

.roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.roster-table th {
  background-color: var(--color-bg-elevated);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 2px solid var(--color-border);
}

.roster-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text-primary);
}

.roster-table tr:hover td {
  background-color: rgba(231, 181, 59, 0.05);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-tf-gold);
  color: var(--color-text-white);
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8), 0 0 10px var(--color-tf-gold-glow);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideIn {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Site Footer
   ========================================================================== */

.site-footer {
  margin-top: auto;
  border-top: 2px solid var(--color-border);
  background-color: var(--color-bg-header);
  padding: 1.5rem 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
}

@media (max-width: 600px) {
  .header-inner {
    height: auto;
    min-height: 56px;
    padding: 0.5rem 0;
    gap: 0.5rem;
  }
  .brand-title {
    font-size: 1.35rem;
  }
  .brand-tagline {
    font-size: 0.68rem;
  }
  .brand-logo {
    width: 32px;
    height: 32px;
  }
}
