/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #4a6cf6;
  --primary-dark: #3a5bd9;
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-light: #666;
  --border: #e8e8e8;
  --success: #2d8a4f;
  --danger: #e74c3c;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Header ===== */
header {
  background: var(--text); color: #fff; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
header .logo { display: flex; align-items: center; gap: 10px; }
header .logo-icon { font-size: 1.5rem; }
header .logo-text { font-size: 1.2rem; font-weight: 700; }
header nav { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
header nav a { color: #ccc; font-size: 0.9rem; text-decoration: none; transition: color 0.2s; }
header nav a:hover, header nav a.active { color: #fff; text-decoration: none; }

/* Nav dropdown */
.nav-dropdown { position: relative; }
.nav-drop-btn {
  background: none; border: none; color: #ccc; font-size: 0.9rem;
  cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: all 0.2s;
  font-family: inherit; display: flex; align-items: center; gap: 4px;
}
.nav-drop-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.nav-dropdown.active-cat .nav-drop-btn { color: #fff; background: rgba(255,255,255,0.15); }
.nav-dropdown-content {
  display: none; position: absolute; top: 100%; left: 0;
  background: #1a1a2e; min-width: 200px; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3); padding: 6px; z-index: 1000;
  flex-direction: column; gap: 2px;
}
.nav-dropdown.open .nav-dropdown-content { display: flex; }
.nav-dropdown-content a {
  color: #ccc; font-size: 0.85rem; padding: 8px 12px; border-radius: 6px;
  white-space: nowrap;
}
.nav-dropdown-content a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.nav-dropdown-content a.active { color: var(--primary); background: rgba(74,108,246,0.15); }

/* ===== Layout ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 30px 20px; flex: 1; width: 100%; }

/* ===== Hero (landing) ===== */
.hero { text-align: center; padding: 40px 20px 50px; }
.hero h1 { font-size: 2.2rem; margin-bottom: 12px; }
.hero p { font-size: 1.1rem; color: var(--text-light); max-width: 600px; margin: 0 auto 30px; }
.hero .badges { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.hero .badge {
  background: #fff; padding: 6px 14px; border-radius: 20px;
  font-size: 0.85rem; color: var(--text-light); box-shadow: var(--shadow);
}

/* ===== Tool Cards (landing) ===== */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.tool-card {
  background: var(--card-bg); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none; color: var(--text); display: block;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.tool-card .icon { font-size: 2.5rem; margin-bottom: 12px; }
.tool-card h2 { font-size: 1.2rem; margin-bottom: 8px; }
.tool-card p { font-size: 0.9rem; color: var(--text-light); }
.tool-card .arrow { margin-top: 12px; color: var(--primary); font-size: 0.9rem; font-weight: 600; }

/* ===== Dropzone ===== */
.dropzone {
  border: 3px dashed #ccc; border-radius: var(--radius); padding: 50px 20px;
  text-align: center; background: var(--card-bg); cursor: pointer;
  transition: all 0.3s; margin-bottom: 20px;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: #f0f4ff; }
.dropzone .icon { font-size: 3rem; margin-bottom: 10px; }
.dropzone p { font-size: 1.05rem; color: var(--text-light); }
.dropzone .hint { font-size: 0.8rem; color: #aaa; margin-top: 8px; }
.dropzone input { display: none; }

/* ===== Privacy Note ===== */
.privacy-note {
  text-align: center; color: var(--success); font-size: 0.85rem;
  margin-bottom: 24px; display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* ===== File List (batch) ===== */
.file-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.file-item {
  background: var(--card-bg); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); display: flex; gap: 16px; align-items: flex-start;
  transition: opacity 0.3s;
}
.file-item.processed { border-left: 4px solid var(--success); }
.file-item.has-gps { border-left: 4px solid var(--danger); }
.file-item .thumb {
  width: 80px; height: 80px; border-radius: 8px; object-fit: cover;
  flex-shrink: 0; background: #eee;
}
.file-item .info { flex: 1; min-width: 0; }
.file-item .filename { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; word-break: break-all; }
.file-item .meta-row { font-size: 0.8rem; color: var(--text-light); display: flex; gap: 12px; flex-wrap: wrap; }
.file-item .meta-row span { white-space: nowrap; }
.file-item .actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.file-item .gps-badge {
  display: inline-block; background: #fee; color: var(--danger);
  padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 600;
}
.file-item .clean-badge {
  display: inline-block; background: #e8f5e9; color: var(--success);
  padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 600;
}

/* ===== Buttons ===== */
.btn {
  padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer;
  font-size: 0.9rem; font-weight: 600; transition: all 0.2s; display: inline-flex;
  align-items: center; gap: 6px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #247a45; }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Action Bar ===== */
.action-bar {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin: 20px 0;
}

/* ===== Detail Panel ===== */
.detail-panel {
  background: var(--card-bg); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.detail-panel h2 { font-size: 1.1rem; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--border); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .detail-grid { grid-template-columns: 1fr; } }

/* ===== Map ===== */
#map, .map-container {
  width: 100%; height: 300px; border-radius: 8px; margin-top: 10px;
}
.no-gps {
  padding: 40px 20px; text-align: center; color: #999;
  background: #f9f9f9; border-radius: 8px;
}

/* ===== EXIF Table ===== */
.tag-group { margin-bottom: 16px; }
.tag-group h3 {
  font-size: 0.8rem; text-transform: uppercase; color: var(--primary);
  margin-bottom: 8px; letter-spacing: 0.5px;
}
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table td { padding: 7px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
table td:first-child { width: 45%; color: var(--text-light); font-weight: 500; }
table td:last-child { word-break: break-all; }

/* ===== Preview Image ===== */
.preview-img { max-width: 100%; max-height: 300px; border-radius: 8px; display: block; margin: 0 auto 15px; }

/* ===== Loading ===== */
.loading { text-align: center; padding: 40px; color: var(--text-light); }
.loading::after {
  content: ''; display: inline-block; width: 30px; height: 30px;
  border: 3px solid #eee; border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite; margin-top: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Modal ===== */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); z-index: 1000; justify-content: center; align-items: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); padding: 30px;
  max-width: 600px; width: 90%; max-height: 80vh; overflow-y: auto;
}
.modal h2 { margin-bottom: 16px; }
.modal .close-btn { float: right; cursor: pointer; font-size: 1.5rem; color: #999; }

/* ===== Footer ===== */
footer {
  text-align: center; padding: 24px 20px; color: #999; font-size: 0.8rem;
  background: var(--text); color: #888;
}
footer a { color: #aaa; }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 60px 20px; color: #aaa; }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

/* ===== Section Title ===== */
.section-title { font-size: 1.3rem; margin-bottom: 20px; }

/* ===== Responsive ===== */
@media (max-width: 600px) {
  header { flex-direction: column; align-items: flex-start; }
  header nav { width: 100%; }
  .hero h1 { font-size: 1.6rem; }
  .file-item { flex-direction: column; }
  .file-item .thumb { width: 100%; height: 160px; }
}
