/* Ground Force Land — Global Styles */

:root {
  /* Status colors */
  --color-researched: #94a3b8;
  --color-contact-made: #fbbf24;
  --color-in-negotiation: #f97316;
  --color-signed: #22c55e;

  --color-survey-todo: #e2e8f0;
  --color-survey-progress: #60a5fa;
  --color-survey-done: #22c55e;

  /* UI colors */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-danger: #ef4444;
  --color-danger-hover: #dc2626;
  --color-success: #22c55e;
  --color-warning: #f59e0b;

  --color-bg: #f1f5f9;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;

  /* Layout */
  --sidebar-width: 240px;
  --header-height: 56px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* App shell layout */
.app-layout {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease;
  overflow: hidden;
}

.sidebar.collapsed,
html.sidebar-collapsed .sidebar {
  width: 56px;
}

.sidebar.collapsed .sidebar-brand,
html.sidebar-collapsed .sidebar .sidebar-brand {
  justify-content: center;
  padding: var(--space-md) var(--space-sm);
}

.sidebar.collapsed .sidebar-brand > span,
html.sidebar-collapsed .sidebar .sidebar-brand > span {
  display: none;
}

.sidebar.collapsed .sidebar-toggle,
html.sidebar-collapsed .sidebar .sidebar-toggle {
  margin-left: 0;
  transform: scaleX(-1);
}

.sidebar.collapsed .nav-link,
html.sidebar-collapsed .sidebar .nav-link {
  justify-content: center;
  padding: var(--space-sm);
  font-size: 0;
  gap: 0;
}

.sidebar.collapsed .sidebar-footer,
html.sidebar-collapsed .sidebar .sidebar-footer {
  display: none;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 18px;
  padding: 4px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  margin-left: auto;
}

.sidebar-toggle:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.sidebar-expand {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  background: var(--color-surface);
  border: none;
  border-right: 1px solid var(--color-border);
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 18px;
  flex-shrink: 0;
  transition: background 0.15s;
}

.sidebar-expand:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.sidebar-brand {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  font-weight: 700;
  font-size: 16px;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md) 0;
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  text-decoration: none;
}
.nav-link:hover {
  background: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
}
.nav-link.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
  border-right: 3px solid var(--color-primary);
}

.nav-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-text-muted);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-header {
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: var(--header-height);
}

.project-name-label {
  width: 100%;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-light);
  letter-spacing: 0.03em;
  line-height: 1;
  margin-bottom: 2px;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 600;
}

.page-body {
  flex: 1;
  padding: var(--space-lg);
  overflow-y: auto;
}

/* Utility */
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: 13px; }
.text-center { text-align: center; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.hidden { display: none !important; }

/* Toast/notification */
.toast {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  color: white;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  animation: slideUp 0.3s ease;
}
.toast.success { background: var(--color-success); }
.toast.error { background: var(--color-danger); }
.toast.warning { background: var(--color-warning); }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  color: var(--color-text-muted);
}
.empty-state h3 {
  font-size: 18px;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}
