/* BigCatch app design system
   Cyan-teal téma, dark mode támogatás, mobile-first.
   Plantora styles.css mintára, slim verzió. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --brand-50:  #ecfeff;
  --brand-100: #cffafe;
  --brand-200: #a5f3fc;
  --brand-300: #67e8f9;
  --brand-400: #22d3ee;
  --brand-500: #06b6d4;
  --brand-600: #0891b2;
  --brand-700: #0e7490;
  --brand-800: #155e75;
  --brand-900: #164e63;
  --text:        #0a1a20;
  --text-muted:  #4a6470;
  --text-faint:  #7e95a0;
  --surface:     #ffffff;
  --surface-2:   #f4fafc;
  --bg:          #f0f9fb;
  --border:      rgba(21, 94, 117, 0.12);
  --border-strong: rgba(21, 94, 117, 0.24);
  --danger:      #dc2626;
  --warning:     #d97706;
  --success:     #059669;
  --bg-image:    radial-gradient(120% 80% at 50% -10%, #d9eef5 0%, #f0f9fb 55%, #e7f3f8 100%);
  --nav-bg:      rgba(255, 255, 255, 0.86);
  --card-shadow:       0 4px 16px rgba(15, 76, 108, 0.06);
  --card-shadow-hover: 0 16px 40px rgba(15, 76, 108, 0.12);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
}

html[data-theme="dark"] {
  --text:        #e6f0f3;
  --text-muted:  #98b3bb;
  --text-faint:  #6b8290;
  --surface:     #142127;
  --surface-2:   #1a2a31;
  --bg:          #0a1418;
  --border:      rgba(34, 211, 238, 0.18);
  --border-strong: rgba(34, 211, 238, 0.32);
  --bg-image:    radial-gradient(120% 80% at 50% -10%, #122428 0%, #0a1418 55%, #050b0c 100%);
  --nav-bg:      rgba(20, 33, 39, 0.86);
  --card-shadow:       0 4px 16px rgba(0,0,0,0.40);
  --card-shadow-hover: 0 16px 40px rgba(0,0,0,0.60);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --text: #e6f0f3; --text-muted: #98b3bb; --text-faint: #6b8290;
    --surface: #142127; --surface-2: #1a2a31; --bg: #0a1418;
    --border: rgba(34, 211, 238, 0.18); --border-strong: rgba(34, 211, 238, 0.32);
    --bg-image: radial-gradient(120% 80% at 50% -10%, #122428 0%, #0a1418 55%, #050b0c 100%);
    --nav-bg: rgba(20, 33, 39, 0.86);
    --card-shadow: 0 4px 16px rgba(0,0,0,0.40);
    --card-shadow-hover: 0 16px 40px rgba(0,0,0,0.60);
  }
}

html, body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; font-size: 16px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
body { background-image: var(--bg-image); background-attachment: fixed; min-height: 100vh; min-height: 100dvh; }
a { color: var(--brand-700); text-decoration: none; transition: color 200ms var(--ease); }
a:hover { color: var(--brand-800); }
html[data-theme="dark"] a { color: var(--brand-300); }
html[data-theme="dark"] a:hover { color: var(--brand-200); }

button, input, select, textarea { font: inherit; color: inherit; }
input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: all 180ms var(--ease);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.20);
}

/* === Splash === */
.splash { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg-image); }
.splash-logo { font-size: 80px; margin-bottom: 24px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: 0.8; } }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border-strong); border-top-color: var(--brand-600); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Layout === */
.app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

header.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg); backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; max-width: 900px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--brand-800); font-size: 17px; }
html[data-theme="dark"] .brand { color: var(--brand-200); }
.brand-logo { font-size: 22px; }

.topbar-actions { display: flex; gap: 8px; align-items: center; }
.topbar-actions button { padding: 7px 12px; border-radius: 8px; font-size: 13px; color: var(--text-muted); }
.topbar-actions button:hover { color: var(--brand-700); background: var(--surface-2); cursor: pointer; }

main.content { flex: 1; padding: 24px 18px 100px; max-width: 900px; width: 100%; margin: 0 auto; animation: fadeIn 320ms var(--ease); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* === Bottom nav (mobile-first) === */
nav.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--nav-bg); backdrop-filter: blur(12px) saturate(140%);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav-inner { display: flex; max-width: 900px; margin: 0 auto; }
.nav-tab { flex: 1; padding: 10px 8px 12px; text-align: center; color: var(--text-muted); cursor: pointer; transition: color 180ms var(--ease); background: none; border: 0; }
.nav-tab .nav-icon { font-size: 22px; display: block; margin-bottom: 2px; }
.nav-tab .nav-label { font-size: 11px; font-weight: 500; }
.nav-tab.active { color: var(--brand-700); }
html[data-theme="dark"] .nav-tab.active { color: var(--brand-300); }
.nav-tab:hover { color: var(--brand-600); }

/* === Buttons === */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: var(--radius-sm); font-weight: 600; transition: all 180ms var(--ease); cursor: pointer; font-size: 14.5px; border: 0; }
.btn-primary { background: var(--brand-700); color: white; box-shadow: 0 6px 18px rgba(14, 116, 144, 0.30); }
.btn-primary:hover:not(:disabled) { background: var(--brand-800); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(14, 116, 144, 0.40); }
.btn-primary:disabled { background: var(--text-faint); cursor: not-allowed; box-shadow: none; }
.btn-ghost { color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface); border-color: var(--border-strong); }
.btn-danger { background: var(--danger); color: white; }
.btn-lg { padding: 14px 24px; font-size: 16px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* === Card === */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--card-shadow); margin-bottom: 16px; }
.card h2 { font-size: 20px; font-weight: 700; color: var(--brand-900); margin-bottom: 12px; letter-spacing: -0.01em; }
html[data-theme="dark"] .card h2 { color: var(--brand-200); }
.card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.card p { color: var(--text-muted); }
.card-compact { padding: 14px 16px; }

/* === Forms === */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-row .hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 8px; padding: 10px 14px; background: rgba(220, 38, 38, 0.08); border-radius: var(--radius-sm); border-left: 3px solid var(--danger); }
.form-success { color: var(--success); font-size: 13px; margin-top: 8px; padding: 10px 14px; background: rgba(5, 150, 105, 0.08); border-radius: var(--radius-sm); border-left: 3px solid var(--success); }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; cursor: pointer; }
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--brand-700); cursor: pointer; }
.checkbox-row span { font-size: 14px; color: var(--text-muted); }

/* === Identify screen === */
.identify-hero { text-align: center; padding: 28px 16px; }
.identify-emoji { font-size: 64px; margin-bottom: 12px; }
.identify-hero h1 { font-size: 24px; margin-bottom: 6px; color: var(--brand-900); }
html[data-theme="dark"] .identify-hero h1 { color: var(--brand-200); }
.identify-hero p { color: var(--text-muted); font-size: 14.5px; }

.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: all 200ms var(--ease);
  margin-bottom: 20px;
}
.upload-zone:hover { background: var(--surface); border-color: var(--brand-500); }
.upload-zone.has-image { padding: 12px; border-style: solid; border-color: var(--brand-500); }
.upload-zone input[type="file"] { display: none; }
.upload-emoji { font-size: 36px; margin-bottom: 10px; }
.upload-preview { max-height: 320px; max-width: 100%; border-radius: var(--radius-sm); margin: 0 auto; }
.upload-help { color: var(--text-muted); font-size: 13.5px; }

/* === Result === */
.result-species { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.result-name { font-size: 24px; font-weight: 700; color: var(--brand-900); }
html[data-theme="dark"] .result-name { color: var(--brand-200); }
.result-latin { font-style: italic; color: var(--text-muted); font-size: 15px; }
.confidence-badge { display: inline-flex; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.confidence-high { background: rgba(5, 150, 105, 0.16); color: var(--success); }
.confidence-medium { background: rgba(217, 119, 6, 0.16); color: var(--warning); }
.confidence-low { background: rgba(220, 38, 38, 0.16); color: var(--danger); }

.feature-list { list-style: none; padding: 0; margin: 12px 0; }
.feature-list li { padding: 6px 0; padding-left: 24px; position: relative; color: var(--text-muted); font-size: 14.5px; }
.feature-list li::before { content: '✓'; position: absolute; left: 0; color: var(--brand-600); font-weight: 700; }

.warn-banner { padding: 12px 16px; border-radius: var(--radius-sm); margin: 12px 0; font-size: 14px; }
.warn-protected { background: rgba(220, 38, 38, 0.10); color: var(--danger); border-left: 4px solid var(--danger); }
.warn-invasive { background: rgba(217, 119, 6, 0.10); color: var(--warning); border-left: 4px solid var(--warning); }

.regs-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.regs-table td { padding: 8px 0; border-bottom: 1px solid var(--border); }
.regs-table td:first-child { color: var(--text-muted); width: 50%; }
.regs-table td:last-child { font-weight: 600; text-align: right; }
.regs-table tr:last-child td { border-bottom: 0; }

/* === Auth screens === */
.auth-card { max-width: 400px; margin: 40px auto 0; }
.auth-title { text-align: center; margin-bottom: 18px; }
.auth-title .emoji { font-size: 48px; display: block; margin-bottom: 8px; }
.auth-title h1 { font-size: 22px; color: var(--brand-900); }
html[data-theme="dark"] .auth-title h1 { color: var(--brand-200); }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); }

/* === Misc === */
.spacer { height: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.tiny { font-size: 12px; }
.hidden { display: none !important; }
