/* TourDev App Styles — matches landing page design system */

:root {
  --bg: #FAFAF7;
  --bg-dark: #1A1A1A;
  --text-primary: #1A1A1A;
  --text-secondary: #5C5C5C;
  --text-muted: #9A9A9A;
  --accent: #C26A3D;
  --accent-warm: #E8A87C;
  --border: #E2E2DE;
  --surface: #F3F3EF;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --radius: 4px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* App Nav */
.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-nav-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
}
.app-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.app-nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.app-nav-links a:hover { color: var(--text-primary); }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #A85A32; }
.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--surface); }
.btn-danger {
  background: #E53935;
  color: #fff;
}
.btn-danger:hover { background: #C62828; }

/* App Layout */
.app-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 24px;
}
.page-header-text {}
.page-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}
.page-subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-top: 8px;
  max-width: 480px;
}

/* Listings Grid */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.listing-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.listing-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.listing-thumbnail {
  width: 100%;
  height: 200px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.listing-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.listing-thumbnail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}
.listing-thumbnail-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}
.listing-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-pending {
  background: rgba(194, 106, 61, 0.15);
  color: var(--accent);
  border: 1px solid rgba(194, 106, 61, 0.3);
}
.badge-ready {
  background: rgba(76, 175, 80, 0.12);
  color: #2E7D32;
  border: 1px solid rgba(76, 175, 80, 0.25);
}
.badge-processing {
  background: rgba(33, 150, 243, 0.12);
  color: #1565C0;
  border: 1px solid rgba(33, 150, 243, 0.25);
}
.listing-body {
  padding: 20px;
}
.listing-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.listing-address {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.listing-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.listing-share-link {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.8125rem;
}
.listing-share-link:hover { text-decoration: underline; }
.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  font-size: 0.8125rem;
  border-radius: var(--radius);
}
.delete-btn:hover { color: #E53935; background: rgba(229, 57, 53, 0.08); }

/* Form */
.form-group {
  margin-bottom: 24px;
}
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.form-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 6px;
}
input[type="text"], input[type="url"], textarea, select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: #fff;
  transition: border-color 0.15s;
}
input[type="text"]:focus, input[type="url"]:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
textarea {
  resize: vertical;
  min-height: 80px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
}
.form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 560px;
}
.form-section {
  margin-bottom: 32px;
}
.form-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 20px;
}
.alert-success {
  background: rgba(76, 175, 80, 0.1);
  color: #2E7D32;
  border: 1px solid rgba(76, 175, 80, 0.25);
}
.alert-error {
  background: rgba(229, 57, 53, 0.1);
  color: #C62828;
  border: 1px solid rgba(229, 57, 53, 0.25);
}

/* Viewer Page */
.viewer-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
}
.viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.viewer-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.viewer-logo {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
}
.viewer-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.15);
}
.viewer-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
}
.viewer-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.viewer-canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
}
#gs-viewer {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--bg-dark);
}
.viewer-overlay {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(26, 26, 26, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  padding: 8px 16px;
}
.viewer-hint {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.5);
}
.viewer-hint strong {
  color: rgba(255,255,255,0.75);
  font-weight: 500;
}
.share-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(194, 106, 61, 0.2);
  border: 1px solid rgba(194, 106, 61, 0.4);
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--accent-warm);
  font-weight: 500;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 32px;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  color: var(--border);
}
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.empty-state p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 768px) {
  .app-nav { padding: 14px 20px; }
  .app-container { padding: 24px 20px; }
  .page-header { flex-direction: column; gap: 16px; }
  .page-title { font-size: 1.5rem; }
  .listings-grid { grid-template-columns: 1fr; }
  .form-card { padding: 20px; }
  .viewer-header { padding: 12px 16px; }
}