/* (c) 2026 A&E Ventures, LLC — All rights reserved. */
/* What Should I Throw? — Proprietary and confidential. */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-light: #252836;
  --accent: #6c63ff;
  --accent-hover: #5a52d5;
  --text: #e0e0e0;
  --text-muted: #888;
  --success: #4caf50;
  --warning: #ff9800;
  --danger: #f44336;
  --border: #2a2d3a;
  --radius: 12px;
  --fsu-garnet: #782F40;
  --fsu-gold: #CEB888;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ======================== LOGIN PAGE ======================== */

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.login-card h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.login-card .subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 0.9rem;
}

/* ======================== FORMS ======================== */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
}

/* ======================== BUTTONS ======================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ======================== ERROR MESSAGE ======================== */

.error-msg {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  display: none;
}

.error-msg.visible { display: block; }

/* ======================== MAIN APP ======================== */

.app-container {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.app-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
}

.app-header .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header .user-name {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.header-btn:hover { color: var(--accent); }

/* ======================== MAP ======================== */

#map {
  height: 50vh;
  height: 50dvh;
  flex-shrink: 0;
}

/* ======================== WEATHER BAR (Phase 2) ======================== */

.weather-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 6px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.wx-item {
  white-space: nowrap;
}

.wx-pressure-falling {
  color: var(--success);
}

.wx-pressure-rising {
  color: var(--warning);
}

/* ======================== CONTROLS ======================== */

.controls {
  background: var(--surface);
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
}

.controls-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.controls-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.species-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' 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 12px center;
  background-size: 20px;
  outline: none;
  transition: border-color 0.2s;
}

.species-select:focus { border-color: var(--accent); }

.species-select option {
  background: var(--surface);
  color: var(--text);
}

.throw-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.throw-btn:hover { background: var(--accent-hover); }
.throw-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.throw-btn.loading {
  color: transparent;
}

.throw-btn.loading::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  top: 50%;
  left: 50%;
  margin-top: -12px;
  margin-left: -12px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.location-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 6px;
}

.location-status.error { color: var(--danger); }
.location-status.success { color: var(--success); }

/* ======================== RESULTS CARD ======================== */

.results-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.results-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.results-card {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 2001;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  max-height: 85vh;
  overflow-y: auto;
}

.results-card.visible {
  transform: translateY(0);
}

.results-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.results-card h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.result-section {
  margin-bottom: 16px;
}

.result-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.result-value {
  font-size: 1rem;
  line-height: 1.5;
}

.result-lure {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}

.confidence-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.confidence-high { background: rgba(76, 175, 80, 0.2); color: var(--success); }
.confidence-medium { background: rgba(255, 152, 0, 0.2); color: var(--warning); }
.confidence-low { background: rgba(244, 67, 54, 0.2); color: var(--danger); }

.alternates-section {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 12px;
}

.alternate-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.alternate-item:last-child { border-bottom: none; }

.alternate-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.alternate-color {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.alternate-why {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.pro-tip {
  background: rgba(108, 99, 255, 0.1);
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 16px;
}

.pro-tip-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.close-results {
  width: 100%;
  padding: 14px;
  margin-top: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.close-results:hover { border-color: var(--accent); }

/* ======================== FISHING METHOD SELECTORS ======================== */

.method-selectors {
  margin-bottom: 4px;
}

/* ======================== CONDITIONS PANEL (Phase 1.5) ======================== */

.conditions-panel {
  margin-bottom: 8px;
}

.conditions-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.conditions-toggle:active {
  color: var(--accent);
}

.conditions-panel.open .conditions-toggle {
  color: var(--accent);
  margin-bottom: 8px;
}

.conditions-toggle-icon {
  font-size: 0.65rem;
  margin-left: 6px;
  transition: transform 0.2s;
}

.conditions-body {
  display: none;
  padding-bottom: 4px;
}

.conditions-panel.open .conditions-body {
  display: block;
}

.condition-group {
  margin-bottom: 10px;
}

.condition-group:last-child {
  margin-bottom: 0;
}

.condition-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  font-weight: 600;
}

.condition-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.condition-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  white-space: nowrap;
  min-height: 32px;
}

.condition-chip:active {
  transform: scale(0.95);
}

.condition-chip.selected {
  background: rgba(108, 99, 255, 0.12);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 8px rgba(108, 99, 255, 0.25);
}

/* ======================== FSU PRANK STYLES ======================== */

/* Prank 1: Pro tip hijack — garnet & gold FSU burn */
.pro-tip.fsu-burn {
  background: rgba(120, 47, 64, 0.15);
  border: 1px solid var(--fsu-garnet);
}

.pro-tip.fsu-burn .pro-tip-label {
  color: var(--fsu-gold);
}

/* Prank 3: FSU lure name in garnet */
.result-lure.fsu-lure {
  color: var(--fsu-garnet);
  text-shadow: 0 0 20px rgba(120, 47, 64, 0.3);
}

/* Prank 3: Real recommendation below the joke */
.fsu-real-rec {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px dashed var(--border);
}

.fsu-real-rec-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 16px;
}

/* Prank 2: Jason welcome banner */
.jason-welcome-banner {
  background: linear-gradient(135deg, var(--fsu-garnet), #5a1f2e);
  color: var(--fsu-gold);
  text-align: center;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  animation: bannerSlide 0.4s ease-out;
}

@keyframes bannerSlide {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Prank 4: Konami code overlay */
.konami-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

.konami-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.konami-content {
  text-align: center;
  cursor: pointer;
  animation: konamiPulse 2s ease-in-out infinite;
}

.konami-dawg {
  font-size: 6rem;
  margin-bottom: 20px;
}

.konami-text {
  font-size: 4rem;
  font-weight: 900;
  color: #DA291C;
  letter-spacing: 8px;
  text-shadow: 0 0 40px rgba(218, 41, 28, 0.5);
}

.konami-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 24px;
}

@keyframes konamiPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Prank 6: FSU Sympathizer badge */
.badge-fsu {
  background: linear-gradient(135deg, var(--fsu-garnet), #5a1f2e);
  color: var(--fsu-gold);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
}

/* ======================== ADMIN PANEL ======================== */

.admin-container {
  min-height: 100vh;
  padding-bottom: 60px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.admin-header h1 {
  font-size: 1.2rem;
}

.admin-version {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-nav {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  overflow-x: auto;
}

.admin-tab {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.admin-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.admin-tab:hover { color: var(--text); }

/* Jason tab special styling */
.admin-tab.tab-jason {
  margin-left: auto;
}

.admin-tab.tab-jason.active {
  color: var(--fsu-gold);
  border-bottom-color: var(--fsu-garnet);
}

.admin-panel {
  padding: 20px;
  display: none;
}

.admin-panel.active { display: block; }

.admin-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.admin-card h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Users table */
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.users-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.users-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.users-table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-admin { background: rgba(108, 99, 255, 0.2); color: var(--accent); }
.badge-user { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }
.badge-active { background: rgba(76, 175, 80, 0.2); color: var(--success); }
.badge-disabled { background: rgba(244, 67, 54, 0.2); color: var(--danger); }

/* Provider toggle */
.provider-toggle {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.provider-option {
  flex: 1;
  padding: 16px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.provider-option.active {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.1);
}

.provider-option .provider-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}

.provider-option .provider-model {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.provider-option .provider-status {
  font-size: 0.75rem;
  margin-top: 8px;
}

.status-ok { color: var(--success); }
.status-none { color: var(--text-muted); }

/* Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

/* ======================== JASON ADMIN PANEL ======================== */

.jason-header-card {
  border-color: var(--fsu-garnet);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(120, 47, 64, 0.08) 100%);
}

.jason-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.jason-emoji {
  font-size: 2rem;
}

.jason-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

.jason-stats {
  display: flex;
  gap: 20px;
}

.jason-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.jason-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fsu-gold);
}

.jason-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border);
  border-radius: 26px;
  transition: all 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--text);
  border-radius: 50%;
  transition: all 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--fsu-garnet);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: var(--fsu-gold);
}

/* Jason toggle rows */
.jason-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.jason-toggle-row:first-of-type {
  padding-top: 0;
}

.jason-toggle-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.jason-toggle-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ======================== MODAL ======================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 440px;
}

.modal h3 {
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-actions .btn { flex: 1; }

/* ======================== FOOTER ======================== */

.app-footer {
  text-align: center;
  padding: 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ======================== TOAST ======================== */

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 9999;
  transform: translateX(120%);
  transition: transform 0.3s;
}

.toast.visible { transform: translateX(0); }
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }

/* ======================== RESPONSIVE ======================== */

@media (min-width: 768px) {
  #map {
    height: 55vh;
    height: 55dvh;
  }

  .controls {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  .controls-row {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }

  .throw-btn {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    display: block;
  }

  .conditions-panel {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }

  .results-card {
    max-width: 500px;
    left: 50%;
    transform: translate(-50%, 100%);
  }

  .results-card.visible {
    transform: translate(-50%, 0);
  }
}

/* ======================== SCROLLBAR ======================== */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ======================== USERS TABLE RESPONSIVE ======================== */

@media (max-width: 600px) {
  .users-table th:nth-child(5),
  .users-table td:nth-child(5) {
    display: none;
  }
}
