/* Lot Log - Community Photo Log Stylesheet */
:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #0284c7;
  --radius: 10px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Status colors */
  --color-empty-bg: #ecfdf5;
  --color-empty-text: #065f46;
  --color-empty-border: #a7f3d0;

  --color-some-bg: #f0f9ff;
  --color-some-text: #0369a1;
  --color-some-border: #bae6fd;

  --color-nearly-bg: #fffbeb;
  --color-nearly-text: #92400e;
  --color-nearly-border: #fde68a;

  --color-full-bg: #fff1f2;
  --color-full-text: #9f1239;
  --color-full-border: #fecdd3;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

blockquote {
  border-left: 3px solid var(--primary);
  background: #f8fafc;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  color: #334155;
  font-style: italic;
  line-height: 1.5;
  border-radius: 0 6px 6px 0;
}

/* Header & Nav */
header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
}

.brand-badge {
  background: #e0e7ff;
  color: #3730a3;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 0.75rem;
  align-items: center;
}

nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

nav a:hover, nav a.active {
  color: var(--primary);
  background-color: #f1f5f9;
}

nav a.btn-cta {
  background-color: var(--primary);
  color: #ffffff;
}

nav a.btn-cta:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
}

/* Main Container */
main {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  flex: 1;
}

/* Page Headers */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Filters bar */
.filter-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 160px;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

select, input[type="text"], input[type="number"], input[type="date"], textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  background-color: #ffffff;
  color: var(--text-main);
  font-family: inherit;
  transition: border-color 0.15s;
}

select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-danger {
  background-color: #dc2626;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-success {
  background-color: #16a34a;
  color: #ffffff;
}

.btn-success:hover {
  background-color: #15803d;
}

/* Gallery Grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.photo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

.photo-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 66.6%; /* 3:2 aspect ratio */
  background-color: #e2e8f0;
  overflow: hidden;
  cursor: pointer;
}

.photo-img-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.photo-img-wrap:hover img {
  transform: scale(1.02);
}

.photo-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.photo-meta-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lot-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-mostly_empty {
  background-color: var(--color-empty-bg);
  color: var(--color-empty-text);
  border: 1px solid var(--color-empty-border);
}

.badge-some_open {
  background-color: var(--color-some-bg);
  color: var(--color-some-text);
  border: 1px solid var(--color-some-border);
}

.badge-nearly_full {
  background-color: var(--color-nearly-bg);
  color: var(--color-nearly-text);
  border: 1px solid var(--color-nearly-border);
}

.badge-full {
  background-color: var(--color-full-bg);
  color: var(--color-full-text);
  border: 1px solid var(--color-full-border);
}

.badge-source {
  background-color: #f1f5f9;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  font-size: 0.7rem;
}

.badge-source.exif {
  color: #047857;
  background-color: #ecfdf5;
  border-color: #a7f3d0;
}

.photo-time {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.photo-note {
  font-size: 0.9rem;
  background-color: #f8fafc;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: #334155;
  border-left: 3px solid #cbd5e1;
}

.spots-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

/* Forms */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.fullness-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.fullness-option {
  position: relative;
}

.fullness-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.fullness-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.5rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.fullness-option input[type="radio"]:checked + .fullness-label {
  border-color: var(--primary);
  background-color: #eff6ff;
  color: var(--primary);
}

.upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  background-color: #f8fafc;
}

.upload-dropzone:hover {
  border-color: var(--primary);
  background-color: #eff6ff;
}

.upload-preview {
  margin-top: 1rem;
  max-height: 260px;
  border-radius: 6px;
  object-fit: contain;
  display: none;
  width: 100%;
}

.guidelines-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.guidelines-box h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.guidelines-box ul {
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Stats Matrix / Heatmap */
.stats-table-wrapper {
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

table.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  min-width: 920px;
}

table.stats-table th, table.stats-table td {
  padding: 0.4rem 0.2rem;
  text-align: center;
  border: 1px solid #e2e8f0;
}

table.stats-table th.col-day, table.stats-table td.col-day {
  position: sticky;
  left: 0;
  background-color: #ffffff;
  z-index: 2;
  box-shadow: 2px 0 3px rgba(0, 0, 0, 0.04);
}

table.stats-table th.col-day {
  background-color: #f8fafc;
}

table.stats-table th {
  background-color: #f8fafc;
  font-weight: 600;
  color: var(--text-muted);
}

.cell-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

.cell-sample {
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 500;
}

.cell-empty {
  color: #94a3b8;
  font-style: italic;
  font-size: 0.75rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  border: none;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer */
footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Mobile Adjustments */
@media (max-width: 640px) {
  .nav-container {
    flex-direction: column;
    gap: 0.5rem;
  }
  .filter-card {
    flex-direction: column;
  }
  .photo-grid {
    grid-template-columns: 1fr;
  }
}
