:root {
    --bg-dark: #09090b;
    --bg-panel: #18181b;
    --border: #27272a;
    --accent: #3f3f46; /* Dark Gray */
    --accent-glow: rgba(63, 63, 70, 0.5);
    --text-main: #e4e4e7;
    --text-muted: #a1a1aa;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-sans: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow-x: hidden; /* App-like feel */
}

/*  Navigation Bar  */
.nav {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.brand {
    font-weight: 800;
    font-size: 1.2rem;
    background: linear-gradient(to right, #ffffff, #71717a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.2rem;
    color: white;
    letter-spacing: -0.02em;
}

.logo-icon {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255,255,255,0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

/*  Inputs & Buttons  */
.input-slug {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
    outline: none;
    transition: all 0.2s;
}

.input-slug:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
}

.btn-primary:hover {
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-1px);
}
.btn-primary,
.btn-card {
    text-decoration: none;
}

.btn-primary:hover,
.btn-card:hover {
    text-decoration: none;
}

.btn-logout {
    background: #27272a;
    border: 1px solid var(--border);
    transition: background-color 0.3s ease;
}

.btn-logout:hover {
    background-color: #772323;
    box-shadow: 0 0 6px rgba(129, 40, 40, 0.884);
}

.btn-success {
    background: #27272a;
    border: 1px solid var(--border);
    transition: background-color 0.3s ease;
}

.btn-success:hover {
    background-color: #2e832e;
    box-shadow: 0 0 4px rgba(30, 215, 42, 0.3);
}

/*  Workspace Layout  */
.workspace {
    display: flex;
    height: calc(100vh - 65px); 
}

.pane {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.resize-divider {
    width: 6px;
    background: var(--border);
    cursor: col-resize;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    user-select: none;
}

.resize-divider:hover {
    background-color: #50c878;
    box-shadow: inset 0 0 8px rgba(80, 200, 120, 0.4);
}

/*  Editor (Textarea)  */
.editor-textarea {
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    color: var(--text-main);
    border: none;
    resize: none;
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    outline: none;
}

/*  Terminal Decoration  */
.terminal-header {
    height: 32px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ef4444; }
.dot.yellow { background: #eab308; }
.dot.green { background: #22c55e; }
.terminal-title { font-size: 12px; color: var(--text-muted); margin-left: 8px; }

.terminal-body {
    flex: 1;
    background: #000;
    padding: 4px 0 8px 4px; /* Added 8px to the bottom */
    overflow: hidden;
}

/*  Markdown Preview (Overrides)  */
.markdown-body {
    padding: 30px;
    overflow-y: auto;
    background-color: var(--bg-dark) !important;
    color: var(--text-main) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.embed-container {
    font-family: var(--font-mono);
}

.embed-overlay {
    backdrop-filter: blur(5px);
}

/* --- Dashboard Styles --- */
.glass-header {
    position: sticky;
    top: 0;
    backdrop-filter: blur(12px);
    background: rgba(9, 9, 11, 0.8);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.dashboard-container {
    min-height: 100vh;
    background: var(--bg-dark);
    
}

.dashboard-hero {
    padding: 60px 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(113, 113, 122, 0.01) 100%);
    border-bottom: 1px solid var(--border);
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin: 0 0 16px 0;
    color: var(--text-main);
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0 0 32px 0;
    line-height: 1.6;
}

.input-hero-wrapper {
    position: relative;
}

.input-hero {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0);
}

.input-hero:focus {
    border-color: var(--accent);
    box-shadow: 0 8px 32px var(--accent-glow);
    transform: translateY(-2px);
}

.input-hero::placeholder {
    color: var(--text-muted);
}

.dashboard-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    cursor: pointer;
}

.project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
    word-break: break-word;
}

.card-body {
    flex: 1;
    padding: 16px 20px;
}

.card-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-meta code {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    color: #e4e4e7;
    font-size: 0.85rem;
    word-break: break-all;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

.btn-card {
    flex: 1;
    padding: 8px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    text-align: center;
    font-size: 0.9rem;
    text-decoration: none;
}

.btn-card:hover {
    box-shadow: 0 4px 12px var(--accent-glow);
    transform: translateY(-1px);
}

.empty-state {
    text-align: center;
    padding: 80px 40px;
    border: 2px dashed var(--border);
    border-radius: 8px;
}

.empty-message {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0 0 24px 0;
}

.error-state {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 32px;
    text-align: center;
}

.error-message {
    color: #fca5a5;
    font-size: 1rem;
    margin: 0 0 16px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* --- Landing Page Styles --- */

.landing-container {
  min-height: 100vh; /* ✅ Allows it to grow if content overflows */
  width: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow-y: auto; /* ✅ Enables vertical scrolling */
  position: relative;
}

/* Background Grid Effect */
.landing-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 3rem;
  width: 100%;
  box-sizing: border-box;
  z-index: 10;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  position: relative;
  z-index: 5;
}

.hero-content {
  max-width: 900px;
  animation: fadeIn 0.8s ease-out;
}

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

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: white;
  letter-spacing: -0.03em;
}

.text-gradient {
  background: linear-gradient(to right, #ffffff, #888888);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 4rem;
}

/* Button Variations */
.btn-nav {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.btn-nav:hover {
  color: white;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-hero {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  color: black;
  font-weight: 700;
  padding: 1rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
  display: flex;
  align-items: center;
  padding: 1rem 2rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.arrow {
  transition: transform 0.2s;
}

.btn-hero:hover .arrow {
  transform: translateX(4px);
}

/* Terminal Preview CSS Graphic */
.terminal-preview {
  width: 100%;
  max-width: 700px;
  background: #000;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.5);
  margin: 0 auto;
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
  animation: slideUp 1s ease-out 0.2s backwards;
}

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

.terminal-header-preview {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-title-preview {
  margin-left: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.terminal-body-preview {
  padding: 1.5rem;
  font-size: 0.9rem;
}

.line {
  margin-bottom: 0.5rem;
  display: block;
}

.prompt {
  color: #4ade80; /* Subtle green for prompt */
  margin-right: 0.75rem;
}

.cmd {
  color: #e5e7eb;
}

.output {
  color: #6b7280;
}

.success {
  color: #22c55e;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 18px;
  background: #e5e7eb;
  animation: blink 1s step-end infinite;
  vertical-align: middle;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .landing-nav {
    padding: 1rem;
  }
  .nav-actions .btn-nav {
    display: none; /* Hide simple login link on mobile to save space */
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .cta-group {
    flex-direction: column;
    width: 100%;
  }
  .btn-hero, .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}