/* Modern Dashboard Theme for Trekkoa
   - Neutral grays, clean cards, subtle borders
   - Primary accent: Indigo with Trekkoa Burgundy as secondary accent
   - Inter font, generous spacing, left-sidebar layout
*/

/* Font stack */
:root {
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Apple Color Emoji, Segoe UI Emoji;

  /* Grays */
  --g-50: #f9fafb;   /* page background */
  --g-100: #f3f4f6;  /* subtle fills */
  --g-200: #e5e7eb;  /* borders */
  --g-300: #d1d5db;
  --g-500: #6b7280;  /* muted text */
  --g-700: #374151;  /* headings */

  /* Accents */
  --indigo-500: #635bff; /* primary */
  --indigo-600: #5148ff;
  --indigo-700: #4338ca;

  /* Trekkoa brand (reduced usage) */
  --burgundy-600: #660530; /* Trekkoa primary */
  --burgundy-500: #7a0a3a;

  /* Surfaces */
  --surface: #ffffff;
  --card-border: var(--g-200);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
}

html, body { height: 100%; }
body { font-family: var(--font-sans); color: var(--g-700); background: var(--g-50); }

/* Layout */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 56px); }
.layout.no-sidebar { grid-template-columns: 1fr; }

.trekkoa-container { max-width: 1280px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); width: 100%; }

/* Topbar */
.topbar { min-height: 56px; background: var(--surface); border-bottom: 1px solid var(--g-200); display: flex; align-items: center; }
.topbar .inner { max-width: 1280px; margin: 0 auto; width: 100%; padding: 0 16px; display:flex; align-items:center; gap:16px; }
.brand { display:flex; align-items:center; gap:8px; color: var(--g-700); text-decoration:none; font-weight:700; }
.brand-mark { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, var(--burgundy-600), var(--burgundy-500)); box-shadow: var(--shadow-sm); }
.brand-name { letter-spacing: -0.01em; }

/* Search */
.search { flex:1; display:flex; }
.search input { width: 100%; background: var(--g-100); border:1px solid var(--g-200); height: 36px; padding: 0 12px; border-radius: 8px; font-size:14px; }
.search input:focus { outline: none; border-color: var(--indigo-500); box-shadow: 0 0 0 3px rgba(99,91,255,0.15); background: #fff; }

/* Actions */
.top-actions { display:flex; align-items:center; gap:12px; flex-wrap: wrap; justify-content:flex-end; }
.split-button { display:inline-flex; align-items:stretch; border-radius:10px; box-shadow:var(--shadow-sm); overflow:visible; position:relative; }
.split-button .btn { padding:8px 16px; font-weight:600; }
.split-button .create-primary { border-radius:10px 0 0 10px; padding-right:20px; }
.split-button .create-toggle { border-radius:0 10px 10px 0; width:46px; padding:0; border-left:1px solid rgba(255,255,255,0.35); display:inline-flex; align-items:center; justify-content:center; font-size:0.8em; line-height:1; }
.split-button .create-toggle span { display:inline-block; transform: translateY(-1px); }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:8px 12px; border-radius:8px; font-weight:600; border:1px solid var(--g-200); background: var(--surface); color: var(--g-700); text-decoration:none; cursor:pointer; height:36px; }
.btn:hover { background: var(--g-100); }
.btn-primary { background: var(--indigo-500); border-color: var(--indigo-500); color:#fff; }
.btn-primary:hover { background: var(--indigo-600); border-color: var(--indigo-600); }
.btn-ghost { border-color: transparent; background: transparent; }

/* Sidebar */
.sidebar { background: var(--surface); border-right: 1px solid var(--g-200); padding: 12px; position: sticky; top: 56px; height: calc(100vh - 56px); }
.side-section { margin-top: 12px; }
.side-label { font-size:12px; color: var(--g-500); text-transform: uppercase; letter-spacing: .06em; padding: 8px 8px; }
.side-link { display:flex; align-items:center; gap:10px; color: var(--g-700); text-decoration:none; padding: 10px 10px; border-radius:8px; margin: 2px 0; }
.side-link:hover { background: var(--g-100); }
.side-link.active { background: rgba(99,91,255,0.1); color: var(--indigo-700); }
.side-badge { margin-left:auto; background: var(--g-100); border:1px solid var(--g-200); padding: 2px 8px; border-radius: 999px; font-size: 12px; color: var(--g-700); }

/* App links (lower emphasis) */
.side-link.app-link { color: var(--g-500); font-size: 13px; }
.side-link.app-link:hover { background: var(--g-50); color: var(--g-700); }
.side-link.app-link.active { background: rgba(99,91,255,0.06); color: var(--indigo-700); }

/* Truncate long labels with ellipsis */
.side-link .link-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Content area */
.content { padding: 24px; }
.page-header { display:flex; align-items:flex-end; justify-content: space-between; gap:16px; margin-bottom: 16px; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.page-subtitle { color: var(--g-500); font-size: 14px; }

/* Cards */
.card { background: var(--surface); border:1px solid var(--card-border); border-radius: 12px; box-shadow: var(--shadow-sm); }
.card-header { padding: 14px 16px; border-bottom: 1px solid var(--g-200); font-weight: 600; }
.card-body { padding: 16px; }
.card-actions { display:flex; gap: 8px; }

/* Forms */
.form-row { margin-bottom: 14px; }
.form-label { display:block; font-size: 13px; color: var(--g-500); margin-bottom: 6px; }
.input, .select, .textarea { width:100%; height: 38px; border:1px solid var(--g-300); border-radius:8px; padding: 8px 12px; background:#fff; }
.textarea { height: auto; min-height: 100px; }
.input:focus, .select:focus, .textarea:focus { outline:none; border-color: var(--indigo-500); box-shadow: 0 0 0 3px rgba(99,91,255,0.15); }

/* Badges & status */
.badge { display:inline-flex; align-items:center; border-radius:999px; padding: 2px 10px; font-size:12px; font-weight:600; border:1px solid var(--g-200); background: var(--g-100); color: var(--g-700); }
.badge.success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.badge.warn { background: #fffbeb; border-color: #fcd34d; color: #8a6d1a; }

/* Footer */
.footer { background: transparent; color: var(--g-500); font-size: 13px; padding: 32px 0; text-align:center; }

/* Utility */
.grid { display:grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* Landing page hero */
.hero-wrap { padding: 64px 0; background: var(--surface); border-bottom: 1px solid var(--g-200); }
.hero-eyebrow { display:inline-flex; align-items:center; gap:8px; padding: 2px 10px; border:1px solid var(--g-200); background: var(--g-100); border-radius:999px; font-size:12px; color: var(--g-700); }
.hero-title { font-size: 44px; line-height: 1.05; letter-spacing: -0.02em; font-weight: 800; color: var(--g-700); margin-top: 14px; }
.hero-sub { color: var(--g-500); font-size: 18px; max-width: 820px; margin-top: 10px; }
.hero-ctas { margin-top: 20px; display:flex; gap: 10px; }
.highlight-burgundy { color: var(--burgundy-600); }

/* Section */
.section { padding: 44px 0; }
.section .title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.muted { color: var(--g-500); }

.idea-starter { padding-top: 16px; padding-bottom: 20px; }
.idea-card { margin: 0 auto; width: 100%; max-width: 900px; padding: 16px; }
.idea-card-body { display:flex; align-items:center; justify-content:center; gap:12px; }
.idea-card .idea-text { flex: 1; min-width: 0; height: auto; min-height: 56px; padding: 12px 14px; border-radius: 12px; border:1px solid var(--g-200); background: var(--surface); font-size: 16px; color: var(--g-700); box-shadow: inset 0 1px 3px rgba(15,23,42,0.05); line-height: 1.45; resize: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; overflow:hidden; }
.idea-card .idea-text:focus { border-color: var(--indigo-500); box-shadow: 0 0 0 3px rgba(99,91,255,0.15); outline: none; }
.idea-card .idea-text::placeholder { color: var(--g-500); }
.idea-card .btn { flex: 0 0 auto; height: 44px; padding: 0 18px; font-size: 15px; }
.idea-card-mark { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, var(--burgundy-600), var(--burgundy-500)); box-shadow: var(--shadow-sm); }

.cta-card { border-left: 4px solid var(--burgundy-600); }
.cta-card-body { display:flex; align-items:center; justify-content: space-between; gap:16px; }
.cta-card-body .page-title { margin-bottom: 4px; }
.cta-button { min-width: 160px; text-align: center; }

/* Feature chips (homepage) */
.feature-chips { display:flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { display:inline-flex; align-items:center; gap:8px; padding: 8px 12px; border-radius: 999px; border:1px solid var(--g-200); background: var(--g-100); color: var(--g-700); font-weight: 600; font-size: 13px; }
.chip::before { content: '\2713'; color: var(--burgundy-600); font-weight: 700; font-size: 12px; }
.chip:hover { background: #eef2ff; border-color: #c7d2fe; }
.chip:focus, .chip:focus-visible { outline: 3px solid rgba(99,91,255,0.25); outline-offset: 2px; }

/* Screen-reader only utility */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 1px, 1px); white-space: nowrap; border: 0; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom:1px solid var(--g-200); }
}

@media (max-width: 900px) {
  .hero-wrap { padding: 52px 0 40px; }
  .hero-title { font-size: 38px; }
  .hero-sub { font-size: 17px; }
}

@media (max-width: 768px) {
  .topbar { padding: 8px 0; }
  .topbar .inner { flex-wrap: wrap; gap: 12px; align-items: flex-start; padding: 12px 16px; }
  .topbar .inner .brand { margin-bottom: 4px; }
  .search { order: 3; width: 100%; }
  .search input { width: 100%; }
  .top-actions { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; justify-content: stretch; justify-items: stretch; }
  .top-actions .btn { flex: initial; justify-content: center; min-height: 40px; width: 100%; }
  .top-actions .split-button { width: 100%; }
  .top-actions .split-button .btn { width: 100%; padding: 10px 14px; }
  .top-actions .split-button .create-toggle { width: 52px; }
}

@media (max-width: 640px) {
  .hero-wrap { padding: 40px 0 28px; text-align: center; }
  .hero-title { font-size: 32px; line-height: 1.15; }
  .hero-sub { font-size: 16px; margin-top: 12px; }
  .hero-eyebrow { margin: 0 auto; }
  .idea-card-body { flex-direction: column; align-items: stretch; }
  .idea-card .idea-text { height: auto; min-height: 104px; padding: 12px 14px; resize: vertical; line-height: 1.5; overflow:auto; }
  .idea-card .btn { width: 100%; min-height: 44px; }
  .idea-card .btn, .idea-card .btn:hover { border-radius: 12px; }
  .idea-card-mark { display: none; }
  .grid.auto { grid-template-columns: 1fr; }
  .cta-card-body { flex-direction: column; align-items: stretch; text-align: center; }
  .cta-card-body .muted { margin-top: 4px; }
  .cta-button { width: 100%; min-height: 48px; }
}

@media (max-width: 560px) {
  .search { display: none; }
  .topbar .inner { justify-content: space-between; }
  .brand { flex: 1 1 auto; }
  .top-actions { grid-template-columns: 1fr; gap: 6px; }
  .hero-title { font-size: 30px; }
}

@media (max-width: 420px) {
  .hero-title { font-size: 28px; }
  .hero-sub { font-size: 15px; }
  .idea-card { padding: 14px; }
  .idea-card .idea-text { min-height: 128px; }
  .idea-card .btn { height: 46px; font-size: 15px; }
  .section { padding: 36px 0; }
}
