:root {
  /* Light Theme */
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-elevated: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --border: #e2e8f0;
  --border-dark: #cbd5e0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 320px;
  --header-height: 64px;
  /* Additional variables from first CSS */
  --code-bg: #f8fafc;
  --code-text: #334155;
  --highlight: #fff3a3;
  /* PDF viewer variables */
  --bg-secondary-rgb: 248, 250, 252;
}

.dark-mode {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-elevated: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --accent: #818cf8;
  --accent-light: #a5b4fc;
  --accent-dark: #6366f1;
  --border: #334155;
  --border-dark: #1e293b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  /* Dark mode overrides for new variables */
  --code-bg: #2d3748;
  --code-text: #e2e8f0;
  --highlight: #ffec99;
  /* PDF viewer dark mode variables */
  --bg-secondary-rgb: 30, 41, 59;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, 
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  transition: var(--transition);
}

#app {
  display: flex;
  height: 100%;
  position: relative;
}

/* Mobile Header */
.mobile-header {
  display: none;
  align-items: center;
  padding: 0 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mobile-header .header-title {
  font-weight: 700;
  margin: 0 auto;
  font-size: 1.2rem;
  color: var(--accent);
}

/* Sidebar */
#sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 90;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sidebar-header {
  display: flex;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-header .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  flex-grow: 1;
  color: var(--accent);
}

.sidebar-header .logo i {
  font-size: 1.5rem;
}

.search-container {
  position: relative;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.search-container i {
  position: absolute;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  z-index: 2;
}

#search {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
  z-index: 1;
}

#search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* File Tree */
.file-tree {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.file-tree details {
  margin-bottom: 0.5rem;
}

.file-tree details > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  transition: var(--transition);
  position: relative;
}

.file-tree details > summary::-webkit-details-marker {
  display: none;
}

.file-tree details > summary::before {
  content: '▸';
  margin-right: 0.75rem;
  color: var(--text-secondary);
  transition: transform 0.2s;
  font-size: 0.9rem;
}

.file-tree details[open] > summary::before {
  transform: rotate(90deg);
}

.file-tree details > summary:hover {
  background: rgba(99, 102, 241, 0.08);
}

.file-tree ul {
  list-style: none;
  margin: 0.5rem 0 0.5rem 1.5rem;
  padding: 0;
  border-left: 1px solid var(--border);
}

.file-tree li.file {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition);
  color: var(--text-secondary);
  margin-left: 0.5rem;
  position: relative;
}

.file-tree li.file::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 50%;
  height: 1px;
  width: 0.75rem;
  background: var(--border);
}

.file-tree li.file:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--text);
}

.file-tree li.file.active {
  background: var(--accent);
  color: white;
}

.file-tree li.file .file-icon {
  width: 1.25rem;
  text-align: center;
  font-size: 1.1rem;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tree-actions {
  display: flex;
  gap: 0.5rem;
}

.app-version {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Main Content */
#content {
  flex: 1;
  overflow-y: auto;
  padding-top: 0;
  background: var(--bg);
}

.content-viewer {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Markdown Viewer Styles */
.markdown-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  line-height: 1.7;
}

.markdown-container h1,
.markdown-container h2,
.markdown-container h3,
.markdown-container h4,
.markdown-container h5,
.markdown-container h6 {
  color: var(--accent);
  margin: 1.75rem 0 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.markdown-container h1 {
  font-size: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-top: 0;
}

.markdown-container h2 {
  font-size: 1.75rem;
}

.markdown-container h3 {
  font-size: 1.5rem;
}

.markdown-container h4 {
  font-size: 1.25rem;
}

.markdown-container p {
  margin: 1.25rem 0;
  color: var(--text);
}

.markdown-container a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

.markdown-container a:hover {
  text-decoration: underline;
  color: var(--accent-light);
}

.markdown-container strong {
  font-weight: 600;
}

.markdown-container em {
  font-style: italic;
}

/* Lists */
.markdown-container ul,
.markdown-container ol {
  margin: 1.25rem 0;
  padding-left: 2rem;
}

.markdown-container li {
  margin: 0.5rem 0;
}

.markdown-container ul {
  list-style-type: disc;
}

.markdown-container ol {
  list-style-type: decimal;
}

/* Tables */
.markdown-container table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.markdown-container th,
.markdown-container td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
}

.markdown-container th {
  background: var(--bg-secondary);
  font-weight: 600;
}

.markdown-container tr:nth-child(even) {
  background: var(--bg-secondary);
}

/* Code */
.markdown-container code {
  font-family: 'Fira Code', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.markdown-container pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.markdown-container pre code {
  padding: 0;
  background: transparent;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Blockquotes */
.markdown-container blockquote {
  border-left: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--bg-secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.markdown-container blockquote p {
  margin: 0;
}

/* Callouts */
.callout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--bg-secondary);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

.callout .callout-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
}

.callout.note {
  --accent: #6366f1;
  border-left-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}

.callout.tip {
  --accent: #10b981;
  border-left-color: var(--accent);
  background: rgba(16, 185, 129, 0.05);
}

.callout.warning {
  --accent: #f59e0b;
  border-left-color: var(--accent);
  background: rgba(245, 158, 11, 0.05);
}

.callout.danger {
  --accent: #ef4444;
  border-left-color: var(--accent);
  background: rgba(239, 68, 68, 0.05);
}

/* Task Lists */
.markdown-container .task-list-item {
  list-style-type: none;
  margin-left: -1.5rem;
}

.markdown-container .task-list-item-checkbox {
  margin-right: 0.5rem;
}

/* Footnotes */
.markdown-container .footnotes {
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding-top: 1rem;
}

.markdown-container .footnote-backref {
  margin-left: 0.25rem;
}

/* Highlight */
.markdown-container mark {
  background: var(--highlight);
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-sm);
}

/* Images */
.markdown-container img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

/* Horizontal Rule */
.markdown-container hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Welcome Screen */
.welcome-screen {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.welcome-content {
  max-width: 800px;
  text-align: center;
  padding: 2rem;
}

.welcome-content h1 {
  font-size: 2.75rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
  font-weight: 800;
}

.welcome-content p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.wave {
  display: inline-block;
  animation: wave 2s infinite;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(10deg); }
  75% { transform: rotate(-10deg); }
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--bg-elevated);
  padding: 2rem 1.5rem;
  border-radius: var(--radius);
  transition: var(--transition);
  border: 1px solid var(--border);
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: var(--accent-light);
}

.feature-card i {
  font-size: 2.25rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.feature-card p {
  font-size: 0.95rem;
  margin-bottom: 0;
  line-height: 1.6;
}

/* Content Viewer Styles */
.content-viewer iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.content-viewer img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.content-viewer .pdf-container, 
.content-viewer .image-container,
.content-viewer .text-container {
  width: 100%;
  height: 100%;
  padding: 2rem;
  overflow: auto;
}

.content-viewer .text-container {
  white-space: pre-wrap;
  font-family: 'Fira Code', monospace;
  line-height: 1.7;
}

.content-viewer .unsupported-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  text-align: center;
}

.content-viewer .unsupported-file i {
  font-size: 3rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.content-viewer .unsupported-file h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.content-viewer .unsupported-file p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.content-viewer .download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.content-viewer .download-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

/* Buttons */
.icon-btn {
  background: transparent;
  border: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}

.icon-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
}

.icon-btn:active {
  transform: scale(0.95);
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ==================== */
/* PDF VIEWER STYLES */
/* ==================== */

.pdf-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* PDF controls - Mobile optimized */
.pdf-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 100;
  width: 100%;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Mobile-specific PDF controls */
@media (max-width: 768px) {
  .pdf-container {
    flex-direction: column-reverse;
  }
  
  .pdf-controls {
    position: fixed;
    left: 0;
    right: 0;
    padding: 1rem;
    backdrop-filter: blur(10px);
    background: rgba(var(--bg-secondary-rgb), 0.95);
  }
  
  /* Hide zoom buttons on mobile - use native pinch-to-zoom */
  .pdf-zoom-btn {
    display: none !important;
  }
}

/* Desktop PDF controls */
@media (min-width: 769px) {
  .pdf-controls {
    border-bottom: 1px solid var(--border);
    border-top: none;
    position: sticky;
    top: 0;
    bottom: auto;
  }
}

.pdf-nav-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
}

.pdf-nav-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.pdf-nav-btn:active {
  transform: scale(0.95);
}

.pdf-page-info {
  font-weight: 600;
  color: var(--text);
  margin: 0 0.8rem;
  font-size: 0.95rem;
  min-width: 120px;
  text-align: center;
  padding: 0.5rem 1rem;
  background: var(--bg);
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* PDF pages container */
#pdf-pages {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-overflow-scrolling: touch;
}

/* PDF page canvas */
.pdf-page {
  max-width: 100%;
  height: auto;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-sm);
  display: block;
}

/* Mobile aspect ratio optimization */
@media (max-width: 768px) {
  #pdf-pages {
    padding: 0.5rem;
    padding-bottom: 5rem; /* Space for fixed controls */
  }
  
  .pdf-page {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }
}

/* Desktop PDF styling */
@media (min-width: 769px) {
  .pdf-page {
    max-width: 90%;
  }
  
  .pdf-zoom-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
  }
  
  .pdf-zoom-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
  }
}

/* PDF loading state */
.pdf-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: var(--text-secondary);
}

/* Ensure proper scrolling on mobile */
.pdf-scroll-container {
  -webkit-overflow-scrolling: touch;
  overflow: auto;
  width: 100%;
  height: 100%;
}

/* Touch-friendly zoom area */
.pdf-touch-zone {
  width: 100%;
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* Dark mode adjustments for PDF */
.dark-mode .pdf-controls {
  background: rgba(var(--bg-secondary-rgb), 0.95);
  border-color: var(--border-dark);
}

.dark-mode .pdf-page-info {
  background: var(--bg);
  border-color: var(--border-dark);
  color: var(--text);
}

.dark-mode .pdf-nav-btn {
  background: var(--bg);
  border-color: var(--border-dark);
  color: var(--text);
}

.dark-mode .pdf-nav-btn:hover {
  background: var(--accent);
  color: white;
}

/* Custom scrollbar for desktop */
@media (min-width: 769px) {
  /* Sidebar scrollbar */
  #sidebar ::-webkit-scrollbar {
    width: 8px;
  }
  
  #sidebar ::-webkit-scrollbar-track {
    background: transparent;
  }
  
  #sidebar ::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
  }
  
  #sidebar ::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
  }
  
  /* Main content scrollbar */
  #content ::-webkit-scrollbar {
    width: 10px;
  }
  
  #content ::-webkit-scrollbar-track {
    background: transparent;
  }
  
  #content ::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
  }
  
  #content ::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
  }
  
  /* Markdown container scrollbar */
  .markdown-container ::-webkit-scrollbar {
    width: 8px;
  }
  
  .markdown-container ::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .markdown-container ::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
  }
  
  .markdown-container ::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
  }
  
  /* Text container scrollbar */
  .text-container ::-webkit-scrollbar {
    width: 8px;
  }
  
  .text-container ::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .text-container ::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
  }
  
  .text-container ::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
  }
  
  /* PDF viewer scrollbar */
  .pdf-container ::-webkit-scrollbar {
    width: 8px;
  }
  
  .pdf-container ::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .pdf-container ::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
  }
  
  .pdf-container ::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
  }
  
  /* Image container scrollbar */
  .image-container ::-webkit-scrollbar {
    width: 8px;
  }
  
  .image-container ::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .image-container ::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
  }
  
  .image-container ::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
  }
}

/* Dark mode adjustments */
.dark-mode #sidebar ::-webkit-scrollbar-thumb,
.dark-mode #content ::-webkit-scrollbar-thumb,
.dark-mode .markdown-container ::-webkit-scrollbar-thumb,
.dark-mode .text-container ::-webkit-scrollbar-thumb,
.dark-mode .pdf-container ::-webkit-scrollbar-thumb,
.dark-mode .image-container ::-webkit-scrollbar-thumb {
  background: var(--border);
}

.dark-mode #sidebar ::-webkit-scrollbar-thumb:hover,
.dark-mode #content ::-webkit-scrollbar-thumb:hover,
.dark-mode .markdown-container ::-webkit-scrollbar-thumb:hover,
.dark-mode .text-container ::-webkit-scrollbar-thumb:hover,
.dark-mode .pdf-container ::-webkit-scrollbar-thumb:hover,
.dark-mode .image-container ::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Ensure all content containers are scrollable */
.markdown-container,
.text-container,
.pdf-container,
.image-container {
  overflow-y: auto;
  max-height: 100%;
}

/* Loading Indicator */
.loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loading-indicator.active {
  opacity: 1;
  pointer-events: auto;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-indicator p {
  color: white;
  font-size: 1.1rem;
}

/* HTML content container */
.html-container {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.html-container > div {
  max-width: 900px;
  width: 100%;
}

/* Ensure HTML content is responsive */
.html-container img {
  max-width: 100%;
  height: auto;
}

.html-container a {
  transition: opacity 0.2s ease;
}

.html-container a:hover {
  opacity: 0.8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .html-container {
    padding: 1rem;
  }
  
  .html-container > div {
    max-width: 100%;
  }
}

/* About Html page styles */
.creator-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  overflow: hidden;
  text-align: center;
  padding-top: 60px; /* space for avatar overlap */
}

/* Banner */
.creator-banner img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

/* Avatar / Logo */
.creator-avatar {
  position: absolute;
  top: 60px; /* controls overlap distance */
  left: 50%;
  transform: translateX(-50%);
}

.creator-avatar img {
  width: 100px;
  height: 100px;
  border-radius: 50%; /* circle avatar */
  border: 4px solid #fff; /* white border like Discord */
  object-fit: cover;
}

.about-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
  color: var(--text);
}

.about-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--border);
}

.about-header h1 {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.about-content section {
  margin-bottom: 3rem;
}

.about-content h2 {
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
}

/* Creator section */
.creator-section {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.creator-card {
  background: var(--bg-elevated);
  padding: 2rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-width: 400px;
}

.creator-avatar {
  font-size: 4rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.creator-card h2 {
  color: var(--text);
  margin-bottom: 0.5rem;
  border: none;
  padding: 0;
}

.creator-title {
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1rem;
}

.creator-bio {
  line-height: 1.6;
}

/* Tech grid */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.tech-card {
  background: var(--bg-elevated);
  padding: 1.5rem;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.tech-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.tech-card i {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.tech-card h3 {
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.feature-item {
  background: var(--bg-elevated);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.feature-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.feature-item i {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.feature-item h3 {
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* Discord contact section */
.discord-contact {
  margin: 2rem 0;
}

.discord-card {
  background: linear-gradient(135deg, #5865F2 0%, #7289DA 100%);
  color: white;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.discord-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.discord-header i {
  font-size: 2.5rem;
}

.discord-header h3 {
  margin: 0;
  color: white;
}

.discord-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 2rem 0;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.step-number {
  background: white;
  color: #5865F2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.step-content h4 {
  margin: 0 0 0.3rem 0;
  color: white;
}

.step-content p {
  margin: 0;
  opacity: 0.9;
}

.discord-cta {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.discord-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  color: #5865F2;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.discord-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  color: #5865F2;
}

/* Existing users section */
.existing-users {
  background: var(--bg-elevated);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.existing-users h3 {
  color: var(--accent);
  margin-bottom: 1rem;
}

.existing-users ol {
  padding-left: 1.5rem;
}

.existing-users li {
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

/* Footer note */
.footer-note {
  text-align: center;
  padding: 2rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  margin-top: 2rem;
}

.closing {
  margin-top: 1.5rem;
  font-style: italic;
  color: var(--text-secondary);
}

/* Responsive design */
@media (max-width: 768px) {
  .about-container {
    padding: 1rem;
  }
  
  .about-header h1 {
    font-size: 2rem;
  }
  
  .tech-grid,
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .creator-card {
    padding: 1.5rem;
  }
  
  .discord-card {
    padding: 1.5rem;
  }
  
  .discord-header {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .step {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .step-number {
    align-self: center;
  }
}

/* Dark mode adjustments */
.dark-mode .discord-card {
  background: linear-gradient(135deg, #5865F2 0%, #4752c4 100%);
}

.dark-mode .existing-users {
  background: var(--bg-secondary);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .markdown-container {
    padding: 1.5rem;
  }
  
  .welcome-content {
    padding: 1.5rem;
  }
  
  .welcome-content h1 {
    font-size: 2.25rem;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
  }
  
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-md);
  }

  #sidebar.active {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-header {
    display: flex;
  }

  #content {
    padding-top: var(--header-height);
  }

  .welcome-content h1 {
    font-size: 2rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .markdown-container {
    padding: 1rem;
  }
  
  .welcome-screen {
    padding: 1rem;
  }
  
  .welcome-content {
    padding: 1rem;
  }

  .welcome-content h1 {
    font-size: 1.75rem;
  }
  
  .feature-card {
    padding: 1.5rem 1rem;
  }
}