/* ================================
   projectHub.css
   Matches Earthwise app design system
================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

:root {
  --sage-50:  #f4f7f2;
  --sage-100: #e8efe4;
  --sage-200: #d0dfc8;
  --sage-300: #a8c49a;
  --sage-500: #5a8f6a;
  --sage-600: #3f7050;
  --sage-700: #2d5239;
  --sage-900: #1b3328;

  --stone-50:  #f9f9f7;
  --stone-100: #f2f2ee;
  --stone-200: #e4e4de;
  --stone-400: #a8a89e;
  --stone-600: #6b6b62;
  --stone-900: #1e1e1a;

  --bg-app:       var(--stone-50);
  --fg:           var(--stone-900);
  --fg-muted:     var(--stone-600);
  --panel-bg:     #ffffff;
  --panel-br:     var(--stone-200);
  --brand:        var(--sage-500);
  --brand-hover:  var(--sage-600);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;

  --shadow-sm: 0 2px 6px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.09);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

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

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg-app);
  color: var(--fg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

/* ================================
   Hub Card Layout
================================ */
.hub-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.hub-card {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 580px;
  max-width: 960px;
  width: 100%;
  background: var(--panel-bg);
  border: 1px solid var(--panel-br);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* ================================
   Left panel — brand / CTA
================================ */
.hub-left {
  background: linear-gradient(160deg, #4a7c59 0%, #1b3328 100%);
  color: #fff;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.hub-logo img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 50%;
  padding: 0px;
}

.hub-title {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.3;
  margin-top: 4px;
}

.hub-subtitle {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
  flex: 1;
}

/* Get Started button */
.hub-btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-lg);
  font: 500 14px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
}

.hub-btn:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.5);
}

/* ================================
   Right panel — project list
================================ */
.hub-right {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}

.hub-right h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.hub-project-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
}

.hub-project-list::-webkit-scrollbar { width: 5px; }
.hub-project-list::-webkit-scrollbar-track { background: transparent; }
.hub-project-list::-webkit-scrollbar-thumb { background: var(--stone-200); border-radius: 10px; }

.empty-msg {
  color: var(--fg-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 48px 20px;
  line-height: 1.7;
}

/* ================================
   Project row card
================================ */
.project-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--panel-br);
  border-radius: var(--radius-lg);
  background: var(--stone-50);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.project-item:hover {
  border-color: var(--sage-300);
  box-shadow: var(--shadow-sm);
}

/* Thumbnail / icon */
.project-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--sage-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  overflow: hidden;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
}

/* Text block */
.project-info {
  flex: 1;
  min-width: 0;
}

.project-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-meta {
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Action buttons */
.project-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Open button — filled sage */
.btn-open {
  padding: 6px 14px;
  background: var(--sage-600);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font: 500 13px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-open:hover {
  background: var(--sage-700);
}

/* Delete button — ghost red */
.btn-delete {
  padding: 6px 10px;
  background: transparent;
  color: var(--stone-400);
  border: 1px solid var(--panel-br);
  border-radius: var(--radius-md);
  font: 400 13px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1;
}

.btn-delete:hover {
  background: #fff5f5;
  color: #c62828;
  border-color: #ffcdd2;
}

/* ================================
   Modal
================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal.hidden { display: none; }

.modal-content {
  background: var(--panel-bg);
  border: 1px solid var(--panel-br);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-content h2 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.modal-content h2 .icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.modal-content label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-content input,
.modal-content textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--fg);
  background: var(--stone-50);
  border: 1px solid var(--panel-br);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  resize: vertical;
}

.modal-content input:focus,
.modal-content textarea:focus {
  border-color: var(--sage-300);
  box-shadow: 0 0 0 3px rgba(90,143,106,0.12);
}

.modal-actions {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

/* Primary create button */
.btn-primary {
  flex: 1;
  padding: 10px 20px;
  background: var(--sage-600);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font: 500 14px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.15s;
}

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

/* Secondary cancel button */
.btn-secondary {
  padding: 10px 20px;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--panel-br);
  border-radius: var(--radius-md);
  font: 400 14px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-secondary:hover {
  background: var(--stone-100);
  color: var(--fg);
}

/* ================================
   Responsive
================================ */
@media (max-width: 680px) {
  .hub-card {
    grid-template-columns: 1fr;
  }

  .hub-left {
    padding: 32px 28px;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
  }

  .hub-logo img { width: 48px; height: 48px; }
  .hub-title { font-size: 1.1rem; }
  .hub-subtitle { display: none; }
  .hub-btn { margin-top: 0; }

  .hub-right { padding: 24px; }
}
