:root {
  /* NotebookLM Dark Theme Palette */
  --bg-body: #131314;
  --bg-panel: #1e1f20;
  --bg-card: #2a2b2d;
  --bg-input: #2a2b2d;
  --bg-hover: #353638;
  
  --text-primary: #e3e3e3;
  --text-secondary: #c4c7c5;
  --text-muted: #8e918f;
  
  --accent-blue: #a8c7fa;
  --accent-purple: #d0bcff;
  --border-color: #444746;
  
  --radius-panel: 16px;
  --radius-card: 12px;
  
  --font-family: 'Roboto', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-family: var(--font-family);
  height: 100vh;
  overflow: hidden;
}

/* --- Main Layout --- */
.app-container {
  display: grid;
  grid-template-columns: 320px 1fr 300px;
  gap: 12px;
  height: 100vh;
  padding: 12px;
}

/* --- Generic Panel Styles --- */
.panel {
  background-color: var(--bg-panel);
  border-radius: var(--radius-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  min-height: 60px;
}

.panel-title {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-primary);
}

.panel-content {
  padding: 0 16px 16px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.divider {
  border: 0;
  border-top: 1px solid var(--border-color);
  width: 100%;
  margin: 8px 0;
}

/* --- Buttons & Icons --- */
.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background-color: rgba(255,255,255,0.08); }

.badge {
  background: var(--accent-blue);
  color: #000;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
}

/* --- LEFT PANEL (Sources) --- */
.action-card-btn {
  width: 100%;
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 12px;
  color: var(--accent-blue);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
}
.action-card-btn:hover { background-color: rgba(168, 199, 250, 0.08); }
.plus-icon { font-size: 18px; line-height: 1; }

/* Input Cards (URL / YT) */
.input-card {
  background-color: var(--bg-card);
  border-radius: 24px;
  padding: 6px 6px 6px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.input-card:focus-within { border-color: var(--accent-blue); }
.input-icon { color: var(--text-secondary); display: flex; align-items: center; }
.input-card input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}
.mini-btn {
  background: var(--bg-hover);
  border: none;
  border-radius: 50%;
  width: 32px; height: 32px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mini-btn:hover { background: #444746; }

/* Source List Items */
.source-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.source-item {
  background-color: var(--bg-card);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255,255,255,0.05);
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.source-info { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.source-type-icon { color: var(--accent-blue); flex-shrink: 0; display: flex; align-items: center; }
.source-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.remove-source-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 16px; /* Adjusted for emoji */
  line-height: 1;
}
.remove-source-btn:hover { color: #ff8b8b; background: rgba(255,0,0,0.1); }

.sources-empty {
  margin-top: 20px;
  text-align: center;
  padding: 20px 10px;
  color: var(--text-muted);
}
.empty-icon-doc { margin-bottom: 12px; opacity: 0.5; }
.sources-empty p { margin: 0 0 8px 0; font-size: 14px; color: var(--text-secondary); }
.sources-empty small { font-size: 12px; line-height: 1.4; display: block; }
.status-text { font-size: 12px; color: var(--accent-blue); margin-top: 4px; min-height: 18px; }

/* --- CENTER PANEL (Chat) --- */
.center-panel { position: relative; }
.header-left { display: flex; align-items: center; gap: 8px; }
.header-right { display: flex; gap: 4px; }

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 40px 100px 40px; /* More padding on sides */
  scroll-behavior: smooth;
}

.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 60px;
}
.upload-circle-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background-color: rgba(168, 199, 250, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.chat-empty-state h1 { font-size: 24px; font-weight: 400; margin: 0 0 24px 0; }
.pill-btn {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.pill-btn:hover { background-color: var(--bg-hover); }

.chat-bubble {
  max-width: 85%;
  padding: 12px 20px;
  margin-bottom: 24px;
  line-height: 1.6;
  font-size: 15px;
  word-wrap: break-word;
}

/* User Bubble: Dark Pill Shape */
.chat-bubble.user {
  align-self: flex-end;
  background-color: #2b303b;
  color: var(--text-primary);
  border-radius: 20px 20px 4px 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Assistant Bubble: Clean Text (NotebookLM Style) */
.chat-bubble.assistant {
  align-self: flex-start;
  background-color: transparent;
  color: var(--text-primary);
  padding-left: 0;
  padding-right: 0;
  width: 100%; /* Allow full width for tables/code */
}

/* Markdown Styling inside Bubbles */
.chat-bubble p { margin: 0 0 12px 0; }
.chat-bubble p:last-child { margin-bottom: 0; }

.chat-bubble strong { color: #fff; font-weight: 600; }
.chat-bubble em { color: var(--accent-blue); font-style: italic; }

.chat-bubble h1, .chat-bubble h2, .chat-bubble h3 {
  margin-top: 20px; margin-bottom: 10px;
  font-weight: 500; color: var(--text-primary);
}
.chat-bubble h1 { font-size: 1.4em; border-bottom: 1px solid var(--border-color); padding-bottom: 5px; }
.chat-bubble h2 { font-size: 1.2em; }
.chat-bubble h3 { font-size: 1.1em; color: var(--accent-blue); }

.chat-bubble ul, .chat-bubble ol { margin: 8px 0 16px 20px; padding: 0; }
.chat-bubble li { margin-bottom: 6px; }

.chat-bubble blockquote {
  border-left: 3px solid var(--accent-blue);
  margin: 12px 0;
  padding-left: 16px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Code Blocks */
.chat-bubble pre {
  background-color: #18191a;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  margin: 12px 0;
}
.chat-bubble code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
  background-color: rgba(255,255,255,0.1);
  padding: 2px 4px;
  border-radius: 4px;
}
.chat-bubble pre code {
  background-color: transparent;
  padding: 0;
  color: #a8c7fa;
}

.chat-bubble a { color: var(--accent-blue); text-decoration: none; }
.chat-bubble a:hover { text-decoration: underline; }

/* Input Area */
.chat-input-container {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 10;
}
.chat-input-wrapper {
  background-color: var(--bg-input);
  border-radius: 30px;
  padding: 12px 12px 12px 24px; /* Larger padding */
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.chat-input-wrapper:focus-within {
  background-color: var(--bg-body);
  border-color: var(--border-color);
}
#chatInput {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
}
.input-actions { display: flex; align-items: center; gap: 12px; }
.source-count { font-size: 12px; color: var(--text-muted); }
.send-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background-color: var(--bg-hover);
  border: none;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.send-btn:hover { background-color: var(--accent-blue); color: #000; }

/* --- RIGHT PANEL (Studio) --- */
.tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tool-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
  min-height: 100px;
  position: relative; /* Needed for badge positioning */
}
.tool-card:hover { background-color: var(--bg-hover); }
.tool-icon { 
  color: var(--text-secondary); 
  font-size: 24px; /* Increased for Emojis */
  line-height: 1;
}
.tool-name { font-size: 14px; font-weight: 500; color: var(--text-primary); }

.saved-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #4caf50; /* Green */
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.studio-empty {
  margin-top: auto;
  text-align: center;
  padding: 20px 10px;
  color: var(--text-muted);
}
.wand-icon { margin-bottom: 12px; opacity: 0.5; }
.studio-empty p { margin: 0 0 8px 0; font-size: 14px; color: var(--text-secondary); }

/* Responsive */
@media (max-width: 1000px) {
  .app-container { grid-template-columns: 280px 1fr; }
  .right-panel { display: none; }
}
@media (max-width: 700px) {
  .app-container { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .left-panel { display: none; }
  .panel { border-radius: 0; }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background-color: var(--bg-panel);
  width: 90%;
  max-width: 1000px;
  height: 85vh;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border: 1px solid var(--border-color);
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
}

.modal-body {
  flex: 1;
  overflow: hidden; /* Important for D3 Zoom */
  position: relative;
  background-color: #1a1b1d; /* Slightly darker for contrast */
}

/* --- MIND MAP VISUALIZATION (D3) --- */
.mindmap-svg {
  width: 100%;
  height: 100%;
  cursor: grab;
}
.mindmap-svg:active {
  cursor: grabbing;
}

.node circle {
  fill: var(--bg-card);
  stroke: var(--accent-blue);
  stroke-width: 2px;
  transition: all 0.3s;
}

.node:hover circle {
  fill: var(--accent-blue);
  stroke: #fff;
  r: 8; /* Expand slightly on hover */
}

.node text {
  font-family: var(--font-family);
  font-size: 12px;
  fill: var(--text-primary);
  text-shadow: 0 1px 3px rgba(0,0,0,0.8); /* Readability on dark bg */
  pointer-events: none;
}

.link {
  fill: none;
  stroke: #555;
  stroke-width: 1.5px;
  opacity: 0.6;
}

/* Loading Spinner for Modal */
.loader {
  border: 4px solid rgba(255,255,255,0.1);
  border-left-color: var(--accent-blue);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: auto;
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.report-wrapper {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 40px;
  background-color: var(--bg-body); /* Dark background matching theme */
}

.report-content {
  max-width: 800px;
  margin: 0 auto;
  color: var(--text-primary);
  font-family: var(--font-family);
  line-height: 1.6;
}

/* Markdown Element Styling */
.report-content h1 {
  font-size: 28px;
  color: var(--accent-blue);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-top: 0;
}

.report-content h2 {
  font-size: 22px;
  color: var(--text-primary);
  margin-top: 30px;
  margin-bottom: 15px;
}

.report-content h3 {
  font-size: 18px;
  color: var(--accent-purple);
  margin-top: 25px;
}

.report-content p {
  margin-bottom: 16px;
  color: #e3e3e3;
}

.report-content ul, .report-content ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.report-content li {
  margin-bottom: 8px;
}

.report-content strong {
  color: #fff;
  font-weight: 600;
}

.report-content blockquote {
  border-left: 4px solid var(--accent-blue);
  background-color: var(--bg-card);
  margin: 20px 0;
  padding: 16px;
  font-style: italic;
  color: var(--text-secondary);
  border-radius: 0 8px 8px 0;
}

.report-content code {
  background-color: #353638;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
}

.report-content pre {
  background-color: #1e1f20;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid var(--border-color);
}

.report-content pre code {
  background-color: transparent;
  padding: 0;
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.flashcard-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
  background-color: var(--bg-body);
}

.flashcard-scene {
  width: 600px;
  height: 400px;
  perspective: 1000px; /* Essential for 3D effect */
  margin-bottom: 30px;
}

/* The card container */
.flashcard {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  cursor: pointer;
}

/* Apply this class via JS to flip */
.flashcard.flipped {
  transform: rotateY(180deg);
}

/* Common face styles */
.flashcard-face {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden; /* Safari */
  backface-visibility: hidden;
  border-radius: 20px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  border: 1px solid var(--border-color);
}

/* FRONT FACE */
.flashcard-front {
  background-color: var(--bg-card);
  color: var(--text-primary);
}

/* BACK FACE */
.flashcard-back {
  background-color: #2b303b; /* Slightly different shade */
  color: var(--text-primary);
  transform: rotateY(180deg);
}

/* Content Styling */
.fc-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.fc-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-blue);
  margin-bottom: 16px;
  opacity: 0.8;
}

#fcQuestion {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.5;
}

#fcAnswer {
  font-size: 20px;
  line-height: 1.6;
}

.fc-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
}

.fc-tags {
  margin-top: 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.fc-tag {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Controls */
.fc-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.fc-counter {
  font-family: monospace;
  color: var(--text-secondary);
}

/* Responsive adjustments */
@media (max-width: 700px) {
  .flashcard-scene {
    width: 90%;
    height: 300px;
  }
  #fcQuestion { font-size: 20px; }
  #fcAnswer { font-size: 18px; }
}

.quiz-container {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 30px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Progress Bar */
.quiz-progress {
  margin-bottom: 24px;
}
.quiz-progress span {
  font-size: 13px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 8px;
}
.progress-bar {
  width: 100%;
  height: 6px;
  background-color: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background-color: var(--accent-blue);
  transition: width 0.3s ease;
}

/* Question Card */
.quiz-card {
  flex: 1;
  overflow-y: auto;
}
.quiz-question {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 24px;
  line-height: 1.4;
  color: var(--text-primary);
}

/* Options */
.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.quiz-option {
  display: flex;
  align-items: center;
  padding: 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.quiz-option:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-secondary);
}
.quiz-option.selected {
  background-color: rgba(168, 199, 250, 0.1);
  border-color: var(--accent-blue);
}

/* Radio Circle UI */
.radio-circle {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  margin-right: 16px;
  position: relative;
}
.quiz-option.selected .radio-circle {
  border-color: var(--accent-blue);
}
.quiz-option.selected .radio-circle::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 10px; height: 10px;
  background-color: var(--accent-blue);
  border-radius: 50%;
}

/* Footer Buttons */
.quiz-footer {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}
.pill-btn.primary {
  background-color: var(--accent-blue);
  color: #000;
  border: none;
}
.pill-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- QUIZ RESULTS --- */
.quiz-results {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 30px;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.score-card {
  text-align: center;
  margin-bottom: 30px;
}
.score-circle {
  background: var(--bg-card);
  border: 4px solid var(--accent-blue);
  border-radius: 50%;
  width: 140px; height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.score-num { font-size: 32px; font-weight: bold; color: var(--text-primary); }
.score-frac { font-size: 12px; color: var(--text-secondary); }

.results-list {
  flex: 1;
  overflow-y: auto;
  padding-right: 10px;
}
.result-item {
  background-color: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid transparent;
}
.result-item.correct { border-left-color: #4caf50; }
.result-item.incorrect { border-left-color: #f44336; }

.result-header {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  font-weight: 500;
}
.q-num { color: var(--text-muted); }

.ans-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 4px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
}
.text-green { color: #81c784; font-weight: bold; }
.text-red { color: #e57373; text-decoration: line-through; }

.explanation {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* 1. Hide scrollbar for Firefox */
.panel-content,
.chat-area,
.modal-body,
.report-wrapper,
.quiz-card,
.results-list {
  scrollbar-width: none;
}

/* 2. Hide scrollbar for IE 10+ */
.panel-content,
.chat-area,
.modal-body,
.report-wrapper,
.quiz-card,
.results-list {
  -ms-overflow-style: none;
}

/* 3. Hide scrollbar for WebKit (Chrome, Safari, Edge) */
.panel-content::-webkit-scrollbar,
.chat-area::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.report-wrapper::-webkit-scrollbar,
.quiz-card::-webkit-scrollbar,
.results-list::-webkit-scrollbar {
  display: none;
  width: 0px;
  background: transparent;
}


.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    height: 100vh;
    overflow-y: auto;
}

.dashboard-header h1 {
    font-weight: 400;
    font-size: 32px;
    margin-bottom: 40px;
}

.section-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.notebook-card {
    background-color: var(--bg-panel);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 220px;
    display: flex;
    flex-direction: column;
    border: 1px solid transparent;
    position: relative;
}

.notebook-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-color: var(--border-color);
}

/* Create Card Specifics */
.create-card {
    background-color: var(--bg-card);
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
}

.create-icon-wrapper {
    width: 56px; height: 56px;
    border-radius: 50%;
    border: 2px solid var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

/* Notebook Item Specifics */
.card-cover {
    height: 100px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon { font-size: 32px; }

.card-info {
    padding: 16px;
    flex: 1;
}

.card-title {
    font-weight: 500;
    font-size: 16px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.card-actions {
    position: absolute;
    top: 8px; right: 8px;
}

.delete-btn {
    background: rgba(0,0,0,0.3);
    border: none;
    color: #fff;
    width: 24px; height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center; justify-content: center;
    font-size: 12px;
}
.delete-btn:hover { background: #ff4d4d; }

/* Notebook Title Input in Header */
.title-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 500;
    outline: none;
    padding: 4px 8px;
    border-radius: 4px;
    width: 250px;
}
.title-input:focus { background-color: var(--bg-hover); }

.pill-btn-sm {
    background-color: var(--accent-blue);
    color: #000;
    border: none;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.pill-btn-sm:hover { opacity: 0.9; }


.card-top {
  flex: 1; /* Takes up top space */
  padding: 20px;
  position: relative;
}

.card-icon-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  /* Icon images usually have a gradient or color in NotebookLM */
  background: linear-gradient(135deg, #444, #222); 
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
}

/* Three dots menu */
.card-menu-btn {
  position: absolute;
  top: 16px;
  right: 12px;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0; /* Hidden by default until hover */
  transition: opacity 0.2s, background 0.2s;
}

.notebook-card:hover .card-menu-btn {
  opacity: 1;
}
.card-menu-btn:hover {
  background-color: rgba(255,255,255,0.1);
}

.card-content {
  padding: 0 20px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title {
  font-size: 18px; /* Larger title */
  font-weight: 400;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.card-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Color Themes for Cards (mimicking the screenshot) */
.theme-brown { background-color: #3e2e28; }
.theme-dark { background-color: #1e1f20; }
.theme-blue { background-color: #1f2b3e; }

/* Responsive adjustments */
@media (max-width: 600px) {
  .dashboard-content { padding: 16px; }
  .notebook-grid { grid-template-columns: 1fr; }
}

.notebook-card {
  background-color: var(--bg-card-surface);
  border-radius: 24px; /* Very rounded corners */
  height: 220px; /* Fixed height based on screenshot */
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid transparent;
}

.notebook-card:hover {
  background-color: var(--bg-card-hover);
}

/* -- Create New Card Specifics -- */
.create-card {
  background-color: var(--bg-card-surface); /* Matches other cards */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.create-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #2e2f33; /* Slightly lighter circle */
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
  transition: background 0.2s;
}

.create-card:hover .create-icon-circle {
  background-color: #3c3d40;
}

.create-text {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 400;
}

.notebook-grid {
  display: grid;
  /* Columns roughly 300px wide, matching the aspect ratio */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding-bottom: 40px;
}

:root {
  --bg-dashboard: #303030; /* Deep dark background */
  --bg-card-surface: #1e1f20; /* Card surface */
  --bg-card-hover: #2a2b2d;
  --text-primary: #e3e3e3;
  --text-secondary: #c4c7c5;
  --accent-blue: #a8c7fa;
  --font-google: 'Google Sans', 'Roboto', sans-serif;
  --radius-lg: 16px; 
}

/* Dashboard Specific Body */
.dashboard-body {
  background-color: var(--bg-dashboard);
  color: var(--text-primary);
  font-family: var(--font-google);
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-bar {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  height: 64px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.logo-icon svg {
  width: 60px;
  height: 60px;
}

.app-name {
  font-size: 40px;
  font-weight: 400; /* Regular weight like screenshot */
  letter-spacing: -0.5px;
}

/* Main Content */
.dashboard-content {
  padding: 20px 40px;
  flex: 1;
  overflow-y: auto;
}

.section-header h2 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 24px;
}


.comparison-wrapper {
  padding: 30px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-body);
}

.comparison-title {
  font-size: 24px;
  color: var(--accent-blue);
  margin-bottom: 20px;
  text-align: center;
  font-weight: 400;
}

.comparison-table-container {
  flex: 1;
  overflow: auto; /* Allows scrolling if table is huge */
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px; /* Force scroll on small screens */
}

.comparison-table th,
.comparison-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
  line-height: 1.5;
}

.comparison-table th {
  background-color: rgba(0, 0, 0, 0.2);
  color: var(--accent-blue);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* First column emphasis */
.comparison-table td:first-child {
  font-weight: 500;
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.1); /* Slight dim for row headers */
}

.comparison-table td:not(:first-child) {
  color: var(--text-secondary);
}

.slides-controls {
  padding: 20px 40px 0 40px;
  display: flex;
  justify-content: flex-end;
}

.deck-wrapper {
  padding: 20px 40px 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: center;
  background-color: var(--bg-body);
}

/* The Slide Aspect Ratio (16:9 approx) */
.slide-card {
  width: 100%;
  max-width: 800px;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  position: relative;
  page-break-after: always; /* Critical for PDF */
}

/* Title Slide Variant */
.slide-card.title-slide {
  background: linear-gradient(135deg, var(--bg-card) 0%, #1f2b3e 100%);
  justify-content: center;
  align-items: center;
  text-align: center;
}
.slide-card.title-slide h1 {
  font-size: 48px;
  color: var(--accent-blue);
  margin: 0 0 16px 0;
}
.slide-card.title-slide p {
  color: var(--text-secondary);
  font-size: 18px;
}

/* Standard Slide Layout */
.slide-header {
  margin-bottom: 24px;
  border-bottom: 2px solid var(--accent-blue);
  padding-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slide-num {
  font-size: 48px;
  font-weight: bold;
  color: rgba(255,255,255,0.05);
  position: absolute;
  top: 20px;
  right: 30px;
  line-height: 1;
}

.slide-header h2 {
  margin: 0;
  font-size: 32px;
  color: var(--text-primary);
  z-index: 1;
}

.slide-body {
  flex: 1;
  font-size: 20px;
  color: var(--text-primary);
}

.slide-body ul {
  margin: 0;
  padding-left: 30px;
}

.slide-body li {
  margin-bottom: 12px;
  line-height: 1.5;
}

.slide-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.speaker-notes {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
}

/* PDF Generation Specifics */
/* When html2pdf runs, it uses these styles */
.deck-wrapper {
  /* Ensure background color persists in PDF */
  -webkit-print-color-adjust: exact; 
}

.slides-main-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background-color: var(--bg-body);
}

.slides-controls {
  padding: 20px 40px 10px 40px;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0; /* Prevent controls from shrinking */
  background-color: var(--bg-body);
  z-index: 10;
}

.deck-wrapper {
  padding: 20px 40px 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: center;
  /* Scroll Logic */
  flex: 1; 
  overflow-y: auto; 
  background-color: var(--bg-body);
}

/* Ensure scrollbar is hidden for deck-wrapper (matching other tools) */
.deck-wrapper {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}
.deck-wrapper::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* The Slide Aspect Ratio (16:9 approx) */
.slide-card {
  width: 100%;
  max-width: 800px;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  position: relative;
  flex-shrink: 0; /* Prevent slides from squishing */
  page-break-after: always;
}