/* SPDX-License-Identifier: MPL-2.0
 * Copyright (c) 2026 DaniDRZ <https://github.com/DaniDRZ>
 * This file is part of Travel Mapper.
 * Co-authored with AI assistance: GLM 5.2 (opencode/glm-5.2) */

:root {
  --bg: #0b1f16;
  --surface: rgba(15,35,25,0.92);
  --border: rgba(74,173,126,0.18);
  --border-bright: rgba(74,173,126,0.45);
  --text: #e8f0eb;
  --text-dim: #7a9e8a;
  --text-faint: #4a6b58;
  --green: #4aad7e;
  --green-bright: #1e7a54;
  --error: #c0485a;
  --warn: #c8a84b;
  --info: #5b9bd5;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
}

* { margin:0; padding:0; box-sizing:border-box; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* --- Top nav --- */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  background: linear-gradient(135deg, #071829 0%, #0b2a1e 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 16px rgba(0,0,0,0.5);
}
.topnav .brand { font-size: 1.1rem; font-weight: 600; color: var(--text); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.user-email { font-size: 0.8rem; color: var(--text-dim); }
.nav-link { color: var(--green); text-decoration: none; font-size: 0.85rem; }
.nav-link:hover { color: var(--text); }

/* --- Container --- */
.container { max-width: 900px; margin: 0 auto; padding: 32px 24px; }

/* --- Auth card --- */
.auth-card {
  max-width: 420px;
  margin: 60px auto;
  padding: 36px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 4px; }
.subtitle { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 24px; }

/* --- Form --- */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.field input, .field select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.field input:focus, .field select:focus { border-color: var(--green); }
.field input[readonly] { color: var(--text-dim); font-family: monospace; }
.hint { font-size: 0.72rem; color: var(--text-faint); }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
}
.btn:hover { border-color: var(--border-bright); }
.btn-primary { background: var(--green-bright); border-color: var(--green-bright); color: #fff; }
.btn-primary:hover { background: var(--green); border-color: var(--green); }
.btn-block { width: 100%; }
.btn-link {
  background: none; border: none; color: var(--green);
  font-size: 0.85rem; cursor: pointer; font-family: inherit;
  padding: 0;
}
.btn-link:hover { color: var(--text); text-decoration: underline; }

/* --- Alerts --- */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 0.85rem; }
.alert ul { margin: 4px 0 0 16px; }
.alert-error { background: rgba(192,72,90,0.12); border: 1px solid rgba(192,72,90,0.3); }
.alert-info { background: rgba(91,155,213,0.12); border: 1px solid rgba(91,155,213,0.3); }

/* --- QR --- */
.qr-container { text-align: center; margin: 24px 0; }
.qr-img { background: #fff; padding: 8px; border-radius: 6px; max-width: 260px; }

/* --- Dashboard --- */
.dashboard h1 { margin-bottom: 8px; }
.empty-state { text-align: center; margin-top: 60px; padding: 40px; }
.empty-state h2 { color: var(--text-dim); margin-bottom: 8px; }
.empty-state p { color: var(--text-faint); margin-bottom: 24px; }

/* --- Admin --- */
.admin-section h1 { margin-bottom: 24px; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.data-table th, .data-table td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.data-table th { color: var(--text-dim); font-weight: 500; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-size: 0.7rem; font-weight: 500;
}
.badge-admin { background: rgba(200,168,75,0.15); color: var(--warn); }
.badge-user { background: rgba(91,155,213,0.15); color: var(--info); }
.badge-ok { background: rgba(74,173,126,0.15); color: var(--green); }
.badge-pending { background: rgba(200,168,75,0.15); color: var(--warn); }
.badge-locked { background: rgba(192,72,90,0.15); color: var(--error); }
.badge-failed { background: rgba(192,72,90,0.15); color: var(--error); }
.badge-partial { background: rgba(200,168,75,0.15); color: var(--warn); }

/* --- Utils --- */
.inline-form { display: inline; }
.auth-help { text-align: center; margin-top: 16px; font-size: 0.85rem; }
.auth-help a { color: var(--text-dim); }
.btn-danger { background: rgba(192,72,90,0.2); border-color: rgba(192,72,90,0.4); color: var(--error); }
.btn-danger:hover { background: rgba(192,72,90,0.3); }
code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 3px; font-family: monospace; }

/* --- Trips --- */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.trips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.trip-card {
  display: block; padding: 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text); transition: border-color .2s;
}
.trip-card:hover { border-color: var(--border-bright); }
.trip-card h3 { font-size: 1.1rem; margin-bottom: 4px; }
.trip-region { color: var(--text-dim); font-size: 0.82rem; }
.trip-dates { color: var(--text-faint); font-size: 0.78rem; display: block; margin-top: 8px; }
.trip-desc { color: var(--text-dim); font-size: 0.8rem; margin-top: 8px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
textarea { resize: vertical; font-family: inherit; }

/* --- Trip view --- */
.trip-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.trip-actions { display: flex; gap: 8px; flex-shrink: 0; }
.trip-stats { display: flex; gap: 20px; margin-bottom: 24px; }
.stat { font-size: 0.9rem; color: var(--text-dim); }
.stat b { color: var(--green); font-size: 1.2rem; }
.clusters-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 32px; }
.cluster-card {
  padding: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px;
}
.cluster-card h3 { font-size: 0.95rem; margin-bottom: 4px; }
.cluster-meta { font-size: 0.75rem; color: var(--text-dim); }
.cluster-date { font-size: 0.72rem; color: var(--text-faint); display: block; margin-top: 4px; }
.photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photo-thumb { position: relative; }
.photo-thumb img { width: 100%; border-radius: 4px; display: block; }
.photo-placeholder {
  width: 100%; aspect-ratio: 1; background: rgba(255,255,255,0.04);
  border-radius: 4px; display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 0.7rem;
}
.photo-date { font-size: 0.65rem; color: var(--text-faint); display: block; margin-top: 2px; }

/* --- Import --- */
.import-section h1 { margin-bottom: 24px; }
.import-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 10px 20px; color: var(--text-dim); text-decoration: none;
  font-size: 0.85rem; border-bottom: 2px solid transparent; transition: all .2s;
}
.tab.active { color: var(--green); border-bottom-color: var(--green); }
.tab:hover { color: var(--text); }
.dropzone {
  border: 2px dashed var(--border); border-radius: 8px; padding: 40px;
  text-align: center; cursor: pointer; transition: border-color .2s; margin-bottom: 16px;
}
.dropzone.dragover { border-color: var(--green); background: rgba(74,173,126,0.05); }
.dropzone p { margin-bottom: 8px; color: var(--text-dim); }
.dropzone .hint { color: var(--text-faint); font-size: 0.75rem; }
.dropzone input[type=file] { margin: 12px 0; }
.import-info { margin-top: 32px; padding: 20px; background: rgba(255,255,255,0.03); border-radius: 6px; }
.import-info h3 { font-size: 0.9rem; margin-bottom: 12px; }
.import-info ol { margin-left: 20px; color: var(--text-dim); font-size: 0.82rem; }
.import-info ol li { margin-bottom: 4px; }
.files-list { max-height: 400px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 8px; margin: 12px 0; }
.file-checkbox { display: flex; align-items: center; gap: 8px; padding: 6px; font-size: 0.82rem; }
.file-checkbox input { flex-shrink: 0; }
