/* FishTrack global styles migrated from globals.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --font-size: 16px;
  /* Modern professional sans stack (Inter-first, great Windows fallback) */
  --font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, 'Noto Sans', 'Liberation Sans', sans-serif;

  /* App theme (light) */
  --background: #f8fafc;
  --foreground: #0f172a;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --border: #e2e8f0;

  --surface: #ffffff;
  --surface-2: #f8fafc;
  --panel: #ffffff;
  --panel-border: rgba(226, 232, 240, 0.75);

  --card: #ffffff;
  --card-foreground: #0f172a;
  --popover: #ffffff;
  --popover-foreground: #0f172a;

  --heading: #1e3a8a;
  --title: #2563eb;

  --primary: #2563eb;
  --primary-foreground: #ffffff;
  --secondary: #334155;
  --secondary-foreground: #ffffff;
  --accent: #e0e7ef;
  --accent-foreground: #1e3a8a;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --success: #059669;

  --input: transparent;
  --input-background: #ffffff;
  --switch-background: #cbd5e1;

  --sidebar-bg: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
  --sidebar-border: rgba(255, 255, 255, 0.10);
  --nav-active-bg: #3b82f6;
  --nav-hover-bg: rgba(255, 255, 255, 0.10);
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  --ring: rgba(37, 99, 235, 0.35);
  --radius: 0.75rem;
  --radius-sm: 0.625rem;
  --radius-lg: 1rem;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 18px 55px rgba(15, 23, 42, 0.16);

  --surface: #ffffff;
  --surface-2: #f8fafc;
  --focus: 0 0 0 4px var(--ring);
}

/* Dark mode (set on <html data-theme="dark">) */
html[data-theme="dark"] {
  color-scheme: dark;

  --background: #0b1220;
  --foreground: #e5e7eb;
  --muted: rgba(15, 23, 42, 0.7);
  --muted-foreground: #9ca3af;
  --border: rgba(148, 163, 184, 0.18);

  --surface: #0f172a;
  --surface-2: #0b1220;
  --panel: #0f172a;
  --panel-border: rgba(148, 163, 184, 0.18);

  --card: #0f172a;
  --card-foreground: #e5e7eb;
  --popover: #0f172a;
  --popover-foreground: #e5e7eb;

  --heading: #e5e7eb;
  --title: #93c5fd;

  --input-background: rgba(2, 6, 23, 0.35);

  --sidebar-bg: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
  --sidebar-border: rgba(148, 163, 184, 0.14);
  --nav-active-bg: rgba(37, 99, 235, 0.45);
  --nav-hover-bg: rgba(148, 163, 184, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 16px 46px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 22px 70px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

body {
  background: var(--background);
  color: var(--foreground);
  font-size: var(--font-size);
  font-family: var(--font-family);
  min-height: 100vh;
  margin: 0;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Optional blended background image layer (enable per-page) */
body.has-bg {
  position: relative;
  isolation: isolate;
  --app-bg-image: none;
  --app-bg-opacity: 0.5;
}

body.has-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--app-bg-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: var(--app-bg-opacity);
}

/* Preset: ocean photo background */
body.bg-ocean {
  --app-bg-image: url('/public/bg-ocean.png');
}

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

p, label, button, input, select, textarea {
  font-weight: var(--font-weight-normal);
  line-height: 1.55;
}

p { margin: 0; }

input, select, textarea {
  background: var(--input-background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65em 0.9em;
  font-family: inherit;
  font-size: 1rem;
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--heading);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: var(--focus);
  border-color: rgba(37, 99, 235, 0.35);
}

button {
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius);
  padding: 0.65em 1em;
  border: 1px solid transparent;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

button:hover { filter: brightness(0.98); box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18); }
button:active { transform: translateY(0.5px); }

a { color: inherit; text-decoration: none; }
a:not(.btn):not(.nav-item):hover { text-decoration: underline; }

#lab-target {
    border: 2.5px solid #7f9cf5;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(60,60,120,0.12), 0 1.5px 6px rgba(60,60,120,0.10);
    padding: 36px 40px;
    min-width: 240px;
    min-height: 48px;
    display: inline-block;
    background: linear-gradient(135deg, #f8fafc 60%, #e0e7ef 100%);
    text-align: center;
    font-size: 1.25em;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    color: #2d3748;
    transition: all 0.3s cubic-bezier(.4,2,.6,1);
    position: relative;
    left: 0;
    opacity: 1;
    margin-bottom: 10px;
}
#lab-target.clicked {
    background: linear-gradient(135deg, #d1ffd1 60%, #b2f2e5 100%);
    border-color: #38b2ac;
}
#lab-target.hovered {
    box-shadow: 0 8px 32px rgba(60,180,120,0.18), 0 2px 8px rgba(60,180,120,0.12);
}

/* (Removed old global demo gradient overrides for all buttons/inputs) */

#hover-para {
    transition: color 0.3s;
}
#hover-para.hovered {
    color: #e53e3e;
}

#details-info {
    border-radius: 10px;
    background: linear-gradient(90deg, #f8fafc 60%, #c3dafe 100%);
    border-left: 5px solid #7f9cf5;
    border: 1px solid #b6c6d6;
    padding: 14px 18px;
    margin: 10px 0;
    color: #2d3748;
    font-size: 1em;
}

#fade-img {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(60,60,120,0.10);
    transition: opacity 0.3s;
    margin-bottom: 10px;
}

/* FishTrack Login Page Styles */
.fishtrack-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

html[data-theme="dark"] .fishtrack-bg {
  background: radial-gradient(1200px 500px at 20% 10%, rgba(37,99,235,0.35) 0%, rgba(11,18,32,1) 65%);
}
.fishtrack-card {
  background: var(--surface);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 10;
  border: 1px solid var(--panel-border);
}
.fishtrack-icon {
  background: #3b82f6;
  padding: 0.75rem;
  border-radius: 50%;
  display: inline-block;
  margin-bottom: 1rem;
}
.fishtrack-title {
  color: var(--title);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.fishtrack-desc {
  color: var(--muted-foreground);
  font-size: 1rem;
  margin-bottom: 2rem;
}
.fishtrack-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.fishtrack-label {
  font-weight: 500;
  color: var(--title);
  margin-bottom: 0.25rem;
}
.fishtrack-input {
  padding: 0.75rem 1rem;
  border-radius: 0.625rem;
  border: 1px solid var(--border);
  background: var(--input-background);
  font-size: 1rem;
  outline: none;
  transition: border 0.2s;
}
.fishtrack-input:focus {
  border-color: #2563eb;
}
.fishtrack-btn {
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  border: none;
  border-radius: 0.625rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.fishtrack-btn:hover {
  background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
}
.fishtrack-link {
  color: #2563eb;
  text-decoration: underline;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  display: inline-block;
}
.fishtrack-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted-foreground);
  font-size: 1rem;
}
.fishtrack-footer-icon {
  font-size: 1.2rem;
  vertical-align: middle;
  margin-right: 0.25rem;
}

/* FishTrack Mockup Layout Styles */
.fishtrack-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px;
}
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  gap: 16px;
}
.sidebar {
  width: 260px;
  flex: 0 0 260px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: white;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.sidebar-header {
  padding: 30px 20px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: #3b82f6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.sidebar-brand h3 {
  font-size: 20px;
  font-weight: 700;
}
.sidebar-brand p {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}
.sidebar-nav {
  flex: 1;
  padding: 20px;
}
.nav-item {
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  text-decoration: none;
}
.nav-item:hover {
  background: var(--nav-hover-bg);
  color: white;
}
.nav-item.active {
  background: var(--nav-active-bg);
  color: white;
  box-shadow: 0 5px 15px rgba(59,130,246,0.4);
}
.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--sidebar-border);
}
.main-content {
  flex: 1;
  min-width: 0;
  background: var(--background);
  padding: 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--panel-border);
}

/* Maps */
.map-canvas {
  height: 400px;
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
  background: var(--muted);
  position: relative;
  overflow: hidden;
}

.map-canvas::after {
  content: attr(data-fallback);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  color: var(--muted-foreground);
  font-weight: 600;
}

.map-canvas.is-ready::after {
  opacity: 0;
  visibility: hidden;
}

.map-canvas.is-error::after {
  color: var(--destructive);
}

@media (max-width: 1100px) {
  .fishtrack-container { padding: 10px; }
  .dashboard-layout { gap: 10px; }
  .main-content { padding: 18px; }
  .sidebar { width: 240px; flex-basis: 240px; }
}

@media (max-width: 860px) {
  .dashboard-layout { flex-direction: column; }
  .sidebar { width: 100%; flex-basis: auto; }
}

/* Shared page scaffolding */
.content-header {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(241,245,249,0.35) 100%);
  padding: 28px 34px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  border: 1px solid var(--panel-border);
}

.content-header h1 {
  font-size: 28px;
  color: var(--heading);
  margin: 0 0 6px 0;
}

.content-header p {
  color: var(--muted-foreground);
  font-size: 14px;
  margin: 0;
  letter-spacing: -0.005em;
}

.content-body { padding: 0; }

/* Cards */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(248,250,252,0.18) 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--panel-border);
  padding: 18px;
  margin-bottom: 18px;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(147, 197, 253, 0.8);
  transform: translateY(-1px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--title);
  margin: 0;
  letter-spacing: -0.015em;
}

.card-body { margin-top: 8px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  padding: 10px 14px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn:active { transform: translateY(0.5px); }

.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { filter: brightness(0.98); box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22); }

.btn-secondary { background: #334155; color: #fff; }
.btn-secondary:hover { filter: brightness(1.02); box-shadow: 0 10px 22px rgba(51, 65, 85, 0.18); }

.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { filter: brightness(0.98); box-shadow: 0 10px 22px rgba(220, 38, 38, 0.20); }

.btn-success { background: #059669; color: #fff; }
.btn-success:hover { filter: brightness(0.98); box-shadow: 0 10px 22px rgba(5, 150, 105, 0.20); }

.btn-ghost {
  background: #ffffff;
  border-color: var(--border);
  color: #475569;
}
.btn-ghost:hover { border-color: #93c5fd; color: #2563eb; box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06); }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: #334155;
}
.btn-icon:hover { border-color: #93c5fd; color: #2563eb; box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06); }
.btn-icon.delete:hover { border-color: rgba(220,38,38,0.4); color: #dc2626; }

/* Notices */
.notice {
  padding: 10px 12px;
  border-radius: 12px;
  margin: 0 0 16px 0;
  background: rgba(37, 99, 235, 0.08);
  color: var(--heading);
  font-weight: 600;
  border: 1px solid var(--border);
}

.notice.error { background: #fee2e2; color: #991b1b; border-color: rgba(220,38,38,0.35); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.badge.active { background: #22c55e; }
.badge.inactive { background: #64748b; }

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--panel-border);
}

.data-table th,
.data-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--muted);
  color: var(--title);
  font-weight: 700;
  font-size: 14px;
}

.data-table tbody tr:hover td {
  background: rgba(219, 234, 254, 0.28);
}

.data-table tr:nth-child(even) td { background: rgba(241, 245, 249, 0.65); }

/* Dashboard stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 18px 0 22px;
}

.stat-card {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(248,250,252,0.12) 100%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }

.stat-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #dbeafe;
  color: #2563eb;
  font-size: 20px;
}

.stat-icon.blue { color: #2563eb; background: #dbeafe; }
.stat-icon.red { color: #ef4444; background: #fee2e2; }
.stat-icon.green { color: #22c55e; background: #dcfce7; }
.stat-icon.emerald { color: #059669; background: #a7f3d0; }

.stat-title { font-size: 1rem; color: #2563eb; font-weight: 700; }
.stat-title { font-size: 1rem; color: var(--title); font-weight: 800; }
.stat-value { font-size: 2.1rem; font-weight: 800; margin: 6px 0 2px; color: var(--heading); }
.stat-trend { color: var(--muted-foreground); font-size: 0.95rem; }

/* Simple layout helpers used in multiple pages */
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

@media (max-width: 900px) {
  .row, .row-3 { grid-template-columns: 1fr; }
}

.muted { color: var(--muted-foreground); font-size: 0.95rem; }
.hint { margin-top: 10px; color: var(--muted-foreground); font-size: 0.95rem; }

.item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.item-ts { color: var(--muted-foreground); font-size: 0.9rem; margin-bottom: 4px; }
