/* ==========================================================================
   KADEN Pavilion — Project Progress Dashboard
   Public client-facing stylesheet
   ========================================================================== */

:root {
  /* Brand colors derived from KADEN + Waves logos */
  --kaden-charcoal: #2f2f2e;
  --kaden-gold: #b6924f;
  --kaden-gold-light: #d8b876;
  --waves-purple: #5a3a92;
  --waves-purple-dark: #402a6c;
  --waves-blue: #2f6fb0;

  --brand-primary: var(--kaden-charcoal);
  --brand-secondary: var(--kaden-gold);
  --brand-accent: var(--waves-purple);

  --background: #f6f5f2;
  --surface: #ffffff;
  --surface-alt: #fbfaf7;
  --text-primary: #24231f;
  --text-secondary: #6c6a63;
  --text-muted: #96938a;
  --border: #e7e4dc;
  --border-strong: #d8d4c8;

  --success: #2f9e5b;
  --warning: #c9862b;
  --danger: #c14545;
  --info: #2f6fb0;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(24, 22, 15, 0.06);
  --shadow-md: 0 8px 24px rgba(24, 22, 15, 0.08);
  --shadow-lg: 0 20px 48px rgba(24, 22, 15, 0.14);

  --container-max: 1180px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  flex-wrap: wrap;
}

.header-brands {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-brands img { height: 42px; width: auto; object-fit: contain; }
.brand-divider { width: 1px; height: 32px; background: var(--border-strong); }

.header-title h1 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

.header-title p {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.meta-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.meta-chip .meta-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.meta-chip .meta-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ---------- Hero / Status ---------- */
.hero {
  padding: 40px 0 8px;
}

.status-card {
  background: linear-gradient(135deg, var(--kaden-charcoal), #1c1c1b 70%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.status-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% -10%, rgba(182, 146, 79, 0.35), transparent 55%);
  pointer-events: none;
}

.status-card .status-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--kaden-gold-light);
  background: rgba(182, 146, 79, 0.15);
  border: 1px solid rgba(182, 146, 79, 0.35);
  padding: 6px 12px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.status-card h2 {
  font-size: 1.6rem;
  margin: 0 0 10px;
  font-weight: 700;
  position: relative;
}

.status-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  max-width: 640px;
  font-size: 0.98rem;
  position: relative;
}

/* ---------- Overview ---------- */
.overview {
  padding: 28px 0;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.3fr 2fr;
  gap: 20px;
}

.progress-card, .stats-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.progress-card .progress-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.progress-card .progress-heading span:first-child {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text-secondary);
}

.progress-card .progress-value {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--brand-primary);
}

.progress-bar-track {
  width: 100%;
  height: 12px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--waves-blue), var(--waves-purple));
  transition: width 0.6s ease;
}

.stats-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-item {
  text-align: center;
  padding: 10px 6px;
  border-radius: var(--radius-md);
}

.stat-item .stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-item .stat-label {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 600;
}

/* ---------- Section headings ---------- */
.section {
  padding: 34px 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-heading h2 {
  font-size: 1.3rem;
  margin: 0;
  font-weight: 800;
  color: var(--text-primary);
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* ---------- Task filters ---------- */
.task-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: 11px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  background: var(--surface);
  color: var(--text-primary);
}
.search-input:focus { outline: 2px solid var(--waves-blue); outline-offset: 1px; }

.filter-select {
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.88rem;
  color: var(--text-primary);
}

/* ---------- Task grid & cards ---------- */
.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-card:hover, .task-card:focus-visible {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
  outline: none;
}

.task-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.task-card h3 {
  font-size: 1rem;
  margin: 0;
  font-weight: 700;
  color: var(--text-primary);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 100px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge .dot { width: 7px; height: 7px; border-radius: 50%; }

.task-card .task-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-progress-row .progress-bar-track { height: 8px; flex: 1; }
.task-progress-row .progress-pct { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); min-width: 38px; text-align: right; }

.task-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.task-thumb-preview {
  display: flex;
  gap: 6px;
  margin-top: -4px;
}
.task-thumb-preview img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}
.empty-state .empty-icon { font-size: 2rem; margin-bottom: 10px; }

/* ---------- Latest updates timeline ---------- */
.updates-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.update-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.update-item:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); }

.update-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.update-item-head .task-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--brand-accent);
}

.update-item-head .update-time {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.update-item p.update-message {
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.update-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.update-thumbs img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* ---------- Photo gallery ---------- */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.photo-gallery .photo-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  cursor: zoom-in;
  background: var(--surface-alt);
}

.photo-gallery .photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.photo-gallery .photo-item:hover img { transform: scale(1.06); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  margin-top: 20px;
  background: var(--surface);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.footer-inner strong { color: var(--text-primary); }

/* ---------- Modal / Drawer (task detail) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.55);
  display: none;
  align-items: stretch;
  justify-content: flex-end;
  z-index: 100;
}
.modal-overlay.open { display: flex; }

.modal-panel {
  background: var(--surface);
  width: min(560px, 100%);
  height: 100%;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.modal-header {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  z-index: 2;
}

.modal-header h2 { margin: 0 0 8px; font-size: 1.15rem; font-weight: 800; }

.modal-close-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.modal-close-btn:hover { background: var(--border); }

.modal-body { padding: 24px; }

.modal-progress-row { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; }
.modal-progress-row .progress-bar-track { flex: 1; height: 10px; }

.modal-body .task-desc-full {
  color: var(--text-secondary);
  font-size: 0.94rem;
  margin: 10px 0 0;
}

.timeline-heading {
  margin-top: 28px;
  margin-bottom: 14px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text-secondary);
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-left: 20px;
  border-left: 2px solid var(--border);
}

.timeline-entry { position: relative; }
.timeline-entry::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--brand-accent);
}

.timeline-date {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}
.timeline-time { font-size: 0.74rem; color: var(--text-muted); margin-left: 6px; font-weight: 500; }

.timeline-message {
  margin: 6px 0 10px;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.timeline-images { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.timeline-images img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 0.84rem;
  background: var(--surface-alt);
}
.attachment-item .att-icon { font-size: 1.2rem; }
.attachment-item .att-meta { color: var(--text-muted); font-size: 0.74rem; }
.attachment-item .att-name { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-item a.att-download { color: var(--brand-accent); font-weight: 700; font-size: 0.78rem; }

/* ---------- Lightbox ---------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 7, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 6px;
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .overview-grid { grid-template-columns: 1fr; }
  .stats-card { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .header-inner { padding: 14px 0; }
  .header-brands img { height: 32px; }
  .header-meta { width: 100%; justify-content: space-between; }
  .meta-chip { align-items: flex-start; padding: 6px 10px; }
  .status-card { padding: 22px; border-radius: var(--radius-md); }
  .status-card h2 { font-size: 1.25rem; }
  .stats-card { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 18px; }
  .progress-card { padding: 18px; }
  .progress-card .progress-value { font-size: 2rem; }
  .task-grid { grid-template-columns: 1fr; }
  .modal-panel { width: 100%; }
  .modal-header, .modal-body { padding: 16px; }
  .section { padding: 24px 0; }
  .lightbox-prev, .lightbox-next { width: 38px; height: 38px; }
}
