/* CEO Personal OS - Style */

:root {
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f5f5f5;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #6b6b6b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e5e5;
  --border-dark: #d4d4d4;
  --success: #16a34a;
  --warning: #ca8a04;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Lora', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 800px;
  --nav-width: 280px;
}

/* Dark mode - system preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1f1f1f;
    --text-primary: #fafafa;
    --text-secondary: #d4d4d4;
    --text-muted: #a3a3a3;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --border: #262626;
    --border-dark: #404040;
  }
}

/* Manual dark mode */
:root[data-theme="dark"] {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1f1f1f;
  --text-primary: #fafafa;
  --text-secondary: #d4d4d4;
  --text-muted: #a3a3a3;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --border: #262626;
  --border-dark: #404040;
}

/* Manual light mode */
:root[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f5f5f5;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #6b6b6b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e5e5;
  --border-dark: #d4d4d4;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--nav-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 2rem 0;
  z-index: 100;
}

.sidebar-header {
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.sidebar-header h1 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.sidebar-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.nav-section {
  padding: 0.75rem 1.5rem;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.nav-section ul {
  list-style: none;
}

.nav-section a {
  display: block;
  padding: 0.4rem 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.nav-section a:hover {
  color: var(--accent);
}

.nav-section a.active {
  color: var(--accent);
  font-weight: 500;
}

/* Main Content */
.main {
  flex: 1;
  margin-left: var(--nav-width);
  padding: 3rem 4rem;
  max-width: calc(var(--max-width) + var(--nav-width) + 8rem);
}

.content {
  max-width: var(--max-width);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 1.25rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.2rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.lead {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Lists */
ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

li::marker {
  color: var(--text-muted);
}

/* Blockquotes */
blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: var(--bg-tertiary);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-secondary);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-tertiary);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

pre {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

td {
  color: var(--text-secondary);
}

tr:hover td {
  background: var(--bg-tertiary);
}

/* Cards */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-md);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.card p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* Grid */
.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Callouts */
.callout {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}

.callout-info {
  background: #eff6ff;
  border-left: 3px solid var(--accent);
}

.callout-success {
  background: #f0fdf4;
  border-left: 3px solid var(--success);
}

.callout-warning {
  background: #fefce8;
  border-left: 3px solid var(--warning);
}

@media (prefers-color-scheme: dark) {
  .callout-info {
    background: rgba(59, 130, 246, 0.1);
  }
  .callout-success {
    background: rgba(22, 163, 74, 0.1);
  }
  .callout-warning {
    background: rgba(202, 138, 4, 0.1);
  }
}

.callout-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

/* Checklist */
.checklist {
  list-style: none;
  padding-left: 0;
}

.checklist li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
}

.checklist li::before {
  content: "\2610";
  position: absolute;
  left: 0;
  color: var(--text-muted);
  transition: color 0.15s;
}

.checklist li.checked::before {
  content: "\2611";
  color: var(--success);
}

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

/* Keyboard shortcuts styling */
kbd {
  display: inline-block;
  padding: 0.2em 0.5em;
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

/* Input fields for interactive templates */
.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  margin: 0.5rem 0 1rem;
  transition: border-color 0.15s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent);
}

textarea.input-field {
  min-height: 100px;
  resize: vertical;
}

/* Section dividers */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* Page header */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Framework badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.badge-time {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
}

/* Print styles */
@media print {
  .sidebar, .nav-toggle {
    display: none;
  }
  .main {
    margin-left: 0;
    padding: 0;
  }
  .content {
    max-width: 100%;
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .main {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .nav-toggle {
    display: block;
  }

  .main {
    margin-left: 0;
    padding: 1.5rem;
    padding-top: 4rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 0.8rem;
  }

  th, td {
    padding: 0.5rem;
  }
}

/* Home page specific */
.hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero .lead {
  max-width: 600px;
  margin: 0 auto 2rem;
}

.quick-start {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2rem 0;
}

.quick-start h2 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.step-number {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.step-content h4 {
  margin: 0 0 0.25rem;
}

.step-content p {
  margin: 0;
  font-size: 0.9rem;
}

/* Credits section */
.credits {
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 2rem;
}

.credits h3 {
  margin-top: 0;
}

.credits ul {
  margin-bottom: 0;
}

/* Textarea for editable sections */
.editable-section {
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1rem 0;
  min-height: 80px;
}

.editable-section:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Rating scale */
.rating-scale {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.rating-scale span {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.rating-scale span:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent);
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
