/**
 * Athabasca Fortress - Components & UI Widgets
 * 1960s Retro-Industrial TF2 x Alberta Backcountry Style
 */

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 26, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--color-boreal-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

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

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

.brand-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--color-parchment-gold);
  overflow: hidden;
  box-shadow: 0 0 12px rgba(226, 190, 120, 0.25);
  flex-shrink: 0;
  transition: transform var(--transition-bounce);
}

.brand-link:hover .brand-badge {
  transform: rotate(-6deg) scale(1.05);
}

.brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.brand-title {
  font-family: var(--font-tf2-header);
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  color: var(--color-parchment-cream);
  line-height: 1;
}

.brand-title span.accent-blu {
  color: var(--color-blu-glacial);
}

.brand-tagline {
  font-family: var(--font-condensed);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-limestone-400);
  margin-top: 2px;
}

/* Nav Links */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  font-family: var(--font-condensed);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--color-limestone-300);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link:hover {
  color: var(--color-parchment-cream);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.nav-link.active {
  color: var(--color-blu-glacial);
  background: rgba(56, 200, 219, 0.12);
  border-bottom: 2px solid var(--color-blu-glacial);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.beacon-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(8, 17, 13, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.5);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-condensed);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #34d399;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.7), 0 0 10px rgba(16, 185, 129, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.beacon-pill.beacon-online {
  background: rgba(6, 24, 16, 0.92);
  border-color: rgba(16, 185, 129, 0.6);
  color: #34d399;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.7), 0 0 12px rgba(16, 185, 129, 0.25);
}

.beacon-pill.beacon-online .pulse-dot {
  background-color: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulse-glow 2s infinite;
}

.beacon-pill.beacon-offline {
  background: rgba(36, 10, 10, 0.94);
  border-color: rgba(239, 68, 68, 0.7);
  color: #fca5a5;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.7), 0 0 12px rgba(239, 68, 68, 0.3);
}

.beacon-pill.beacon-offline .pulse-dot {
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: none;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulse-glow 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ==========================================================================
   Buttons & Controls (1960s TF2 Tactile Industrial Feel)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-tf2-header);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  user-select: none;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(2px);
}

/* Primary BLU: Glacial Button */
.btn-blu, .btn-primary {
  background: linear-gradient(180deg, var(--color-blu-glacial-light) 0%, var(--color-blu-glacial) 50%, var(--color-blu-glacial-dark) 100%);
  color: #06181d;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-bottom: 3px solid var(--color-blu-glacial-deep);
  box-shadow: 0 4px 10px rgba(56, 200, 219, 0.3), var(--shadow-inset-bevel);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-blu:hover, .btn-primary:hover {
  background: linear-gradient(180deg, #8dedf8 0%, var(--color-blu-glacial-light) 50%, var(--color-blu-glacial) 100%);
  box-shadow: 0 6px 16px rgba(56, 200, 219, 0.5), var(--shadow-inset-bevel);
  color: #031114;
}

/* Primary RED: Jasper Button */
.btn-red {
  background: linear-gradient(180deg, var(--color-red-jasper-light) 0%, var(--color-red-jasper) 50%, var(--color-red-jasper-dark) 100%);
  color: #ffffff;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom: 3px solid var(--color-red-jasper-deep);
  box-shadow: 0 4px 10px rgba(200, 70, 48, 0.35), var(--shadow-inset-bevel);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.btn-red:hover {
  background: linear-gradient(180deg, #eb7461 0%, var(--color-red-jasper-light) 50%, var(--color-red-jasper) 100%);
  box-shadow: 0 6px 16px rgba(200, 70, 48, 0.55), var(--shadow-inset-bevel);
  color: #ffffff;
}

/* Secondary Outpost Ranger Button */
.btn-secondary {
  background: linear-gradient(180deg, var(--color-boreal-pine) 0%, var(--color-boreal-surface) 100%);
  color: var(--color-parchment-cream);
  border: 1px solid var(--color-boreal-border);
  border-bottom: 3px solid #08120d;
}

.btn-secondary:hover {
  background: linear-gradient(180deg, var(--color-boreal-moss) 0%, var(--color-boreal-pine) 100%);
  border-color: var(--color-boreal-moss);
  color: #ffffff;
}

/* Ghost / Riveted Button */
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-limestone-300);
  border: 1px solid var(--color-limestone-700);
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-parchment-cream);
  border-color: var(--color-limestone-500);
}

/* Hazard Yellow Button */
.btn-hazard {
  background: linear-gradient(180deg, #fde047 0%, #eab308 50%, #ca8a04 100%);
  color: #1c1917;
  font-weight: 900;
  border-bottom: 3px solid #854d0e;
  box-shadow: 0 4px 10px rgba(234, 179, 8, 0.35);
}

.btn-hazard:hover {
  background: linear-gradient(180deg, #fef08a 0%, #facc15 50%, #eab308 100%);
  box-shadow: 0 6px 16px rgba(234, 179, 8, 0.55);
}

/* Button Sizing */
.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.25rem;
}

.btn-icon {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
}

/* ==========================================================================
   Badges, Pills & Status Tags
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-condensed);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

.badge-blu {
  background: rgba(56, 200, 219, 0.15);
  color: var(--color-blu-glacial);
  border: 1px solid rgba(56, 200, 219, 0.3);
}

.badge-red {
  background: rgba(200, 70, 48, 0.15);
  color: var(--color-red-jasper-light);
  border: 1px solid rgba(200, 70, 48, 0.3);
}

.badge-pine {
  background: rgba(46, 87, 68, 0.25);
  color: var(--color-boreal-moss);
  border: 1px solid var(--color-boreal-border);
}

.badge-slate {
  background: rgba(18, 21, 23, 0.88);
  color: var(--color-limestone-200);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.badge-gold {
  background: rgba(226, 190, 120, 0.15);
  color: var(--color-parchment-gold);
  border: 1px solid rgba(226, 190, 120, 0.3);
}

/* ==========================================================================
   Cards & Outpost Panels
   ========================================================================== */

.card {
  background: var(--color-boreal-surface);
  border: 1px solid var(--color-boreal-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  border-color: var(--color-boreal-pine);
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-boreal-border);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1.2rem;
  margin: 0;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-boreal-border);
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 1960s Wilderness Directive / Stamped Paper Card */
.directive-card {
  background: #1e2621;
  border: 2px dashed var(--color-parchment-dark);
  border-radius: var(--radius-md);
  padding: 2rem;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5), var(--shadow-md);
}

.directive-card::before {
  content: 'FIELD DIRECTIVE';
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--color-red-jasper);
  color: #fff;
  font-family: var(--font-condensed);
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* ==========================================================================
   Form Controls, Inputs & Filters
   ========================================================================== */

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: var(--font-condensed);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-limestone-300);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.input-text,
.select-control {
  width: 100%;
  background: var(--color-boreal-black);
  border: 1px solid var(--color-boreal-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-parchment-cream);
  outline: none;
  transition: all var(--transition-fast);
}

.input-text:focus,
.select-control:focus {
  border-color: var(--color-blu-glacial);
  box-shadow: 0 0 0 3px rgba(56, 200, 219, 0.2);
}

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

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field .search-icon {
  position: absolute;
  left: 1rem;
  color: var(--color-limestone-500);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.search-field input {
  padding-left: 2.75rem;
}

/* Select wrapper */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '▼';
  font-size: 0.65rem;
  color: var(--color-limestone-400);
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.select-control {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* ==========================================================================
   Modals & Drawers
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 9, 7, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 1;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

.modal-card {
  background: var(--color-boreal-surface);
  border: 2px solid var(--color-boreal-border);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 200, 219, 0.1);
  overflow: hidden;
  animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-lg {
  max-width: 900px;
}

@keyframes modal-pop {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 1.25rem 1.75rem;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 2px solid var(--color-boreal-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--color-limestone-400);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--color-red-jasper-light);
}

.modal-body {
  padding: 1.75rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1.25rem 1.75rem;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--color-boreal-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==========================================================================
   Toasts & Alerts
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 320px;
  background: var(--color-boreal-surface);
  border-left: 4px solid var(--color-blu-glacial);
  border-top: 1px solid var(--color-boreal-border);
  border-right: 1px solid var(--color-boreal-border);
  border-bottom: 1px solid var(--color-boreal-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-lg);
  color: var(--color-parchment-cream);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: toast-slide 0.3s ease-out;
}

.toast.toast-red {
  border-left-color: var(--color-red-jasper);
}

.toast.toast-gold {
  border-left-color: var(--color-caution-amber);
}

@keyframes toast-slide {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

.site-footer {
  margin-top: auto;
  background: var(--color-boreal-deep);
  border-top: 2px solid var(--color-boreal-border);
  padding: 4rem 0 2rem;
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col h4 {
  font-size: 1.1rem;
  color: var(--color-parchment-cream);
  margin-bottom: 1.25rem;
  position: relative;
  display: inline-block;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--color-blu-glacial);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--color-limestone-400);
  font-size: 0.95rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-blu-glacial);
  text-decoration: none;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--color-limestone-500);
}
