/**
 * Global styles for Plot of Land app
 * Minimalistic, responsive design with focus on usability
 */

:root {
  --bg: #f7f7f7;
  --surface: #ffffff;
  --ink: #111111;
  --muted: #666666;
  --border: #e5e5e5;
  --accent: #0a84ff;
  --accent-hover: #0066cc;
  --danger: #ff3b30;
  --success: #34c759;
  --warning: #ff9500;
  --flood: #ffe58f;
  --flood-dark: #d99;
  --grid-light: #eeeeee;
  --grid-major: #dddddd;
  --shadow: rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.logo {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  background: var(--flood);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.flood-badge {
  background: var(--flood);
  color: #8b4513;
}

.nav {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.nav-link {
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  transition: background 0.2s;
}

.nav-link:hover {
  background: var(--bg);
}

.nav-link.active {
  background: var(--accent);
  color: white;
}

/* Footer */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px;
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.footer-links {
  margin-top: 8px;
}

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

/* Buttons */
button, .btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

button:hover, .btn:hover {
  background: var(--bg);
  border-color: var(--accent);
}

button:active, .btn:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

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

.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn-small {
  padding: 4px 8px;
  font-size: 12px;
}

/* Inputs */
input, textarea, select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

textarea {
  resize: vertical;
  min-height: 60px;
}

label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  font-size: 13px;
}

.form-group {
  margin-bottom: 12px;
}

/* Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
}

.split-layout {
  display: flex;
  gap: 16px;
  height: calc(100vh - 180px);
}

.sidebar {
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-y: auto;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

/* Canvas */
.canvas-container {
  width: 100%;
  height: 100%;
  overflow: auto;
  position: relative;
  background: #fafafa;
}

#canvas {
  display: block;
  margin: 20px auto;
  background: white;
  box-shadow: 0 2px 8px var(--shadow);
}

.canvas-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  background: var(--surface);
  padding: 8px;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
}

/* Palette */
.palette {
  margin-bottom: 20px;
}

.palette h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
}

.palette-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.palette-item {
  padding: 12px 8px;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.palette-item:hover {
  border-color: var(--accent);
  background: var(--bg);
}

/* Properties Panel */
.properties {
  margin-bottom: 20px;
}

.properties h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
}

.prop-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.prop-row label {
  flex: 0 0 60px;
  margin: 0;
  font-size: 12px;
}

.prop-row input {
  flex: 1;
  padding: 4px 8px;
  font-size: 12px;
}

/* Gallery */
.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.gallery-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-box {
  width: 200px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.design-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  transition: all 0.2s;
  cursor: pointer;
}

.design-card:hover {
  box-shadow: 0 4px 12px var(--shadow);
  transform: translateY(-2px);
}

.design-thumbnail {
  width: 100%;
  height: 180px;
  background: var(--bg);
  border-radius: 6px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

.design-title {
  font-weight: 600;
  margin: 0 0 4px 0;
  font-size: 15px;
}

.design-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.vote-count {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Design View */
.design-view {
  padding: 24px;
}

.design-header {
  margin-bottom: 24px;
}

.design-header h2 {
  margin: 0 0 8px 0;
}

.design-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* Utility */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.text-muted {
  color: var(--muted);
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }

/* Responsive */
@media (max-width: 768px) {
  .split-layout {
    flex-direction: column;
    height: auto;
  }
  
  .sidebar {
    width: 100%;
  }
  
  .main-content {
    min-height: 500px;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Measurement overlays */
.measurements {
  pointer-events: none;
}

.measurements line {
  opacity: 0.8;
}

.measurements text {
  text-shadow: 0 0 2px white, 0 0 2px white;
}

.sqft-label, .dim-label {
  text-shadow: 0 0 2px rgba(0,0,0,0.5), 0 0 2px rgba(0,0,0,0.5);
}

