/* VoicEdit Web Application Styles */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
}

/* Navigation */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--gray-600);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background: var(--gray-100);
  color: var(--primary);
}

.nav-auth,
.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-tier {
  padding: 0.25rem 0.5rem;
  background: var(--primary-light);
  color: var(--white);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.user-name {
  font-weight: 500;
}

.hidden {
  display: none !important;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
}

.btn-outline:hover {
  background: var(--gray-100);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  padding: 0.5rem;
  min-width: 40px;
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

/* Pages */
.page {
  display: none;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.page.active {
  display: block;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  margin-bottom: 3rem;
}

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

.hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2rem;
}

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

.hero-features {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-features .feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.feature-icon {
  font-size: 1.25rem;
}

/* Features Section */
.features-section {
  padding: 2rem 0;
}

.features-section h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-align: center;
}

.feature-number {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}

.feature-card h3 {
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--gray-600);
}

/* Editor */
.editor-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-title-input {
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.doc-title-input:focus {
  outline: none;
  background: var(--white);
}

.save-status {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.editor {
  min-height: 500px;
  padding: 2rem;
  font-size: 1rem;
  line-height: 1.8;
  outline: none;
}

.editor:empty:before {
  content: 'Start typing or use voice commands...';
  color: var(--gray-400);
}

.editor-footer {
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.usage-indicator {
  margin-left: auto;
}

/* Mic Button */
#voiceToggle {
  position: relative;
}

#voiceToggle.active {
  background: var(--danger);
  color: var(--white);
}

#voiceToggle.active .mic-icon {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Documents */
.documents-container {
  max-width: 900px;
  margin: 0 auto;
}

.documents-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.documents-list {
  display: grid;
  gap: 1rem;
}

.document-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.document-info h4 {
  margin-bottom: 0.25rem;
}

.document-meta {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--gray-500);
}

/* Pricing */
.pricing-container {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.pricing-container h2 {
  margin-bottom: 0.5rem;
}

.pricing-subtitle {
  color: var(--gray-600);
  margin-bottom: 2rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.pricing-grid.three-col {
  grid-template-columns: repeat(3, 1fr);
  max-width: 1000px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .pricing-grid.three-col {
    grid-template-columns: 1fr;
  }
}

.pricing-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  position: relative;
}

.pricing-card.featured {
  border: 2px solid var(--primary);
}

.pricing-badge {
  position: absolute;
  top: -10px;
  right: 20px;
  background: var(--primary);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pricing-tier {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.pricing-price {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary);
}

.pricing-price span {
  font-size: 1rem;
  color: var(--gray-500);
}

.pricing-note {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
}

.pricing-features {
  list-style: none;
  text-align: left;
  margin: 1.5rem 0;
}

.pricing-features li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.pricing-features li:before {
  content: '✓';
  color: var(--secondary);
  margin-right: 0.5rem;
}

.pricing-footnote {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-style: italic;
  margin-bottom: 1rem;
}

/* Dashboard */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-container h2 {
  margin-bottom: 1.5rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
}

.dashboard-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.dashboard-card h3 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.usage-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  color: var(--gray-600);
  font-size: 0.875rem;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}

.account-info p {
  margin-bottom: 0.5rem;
}

.api-keys-list {
  margin-bottom: 1rem;
  max-height: 150px;
  overflow-y: auto;
}

.api-key-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: var(--gray-100);
  border-radius: 4px;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

/* BYOK Card */
.byok-card {
  border: 2px solid var(--primary-light);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
}

.byok-info {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
}

.byok-form .form-group {
  margin-bottom: 1rem;
}

.byok-form input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.key-status {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.key-status.configured {
  color: var(--secondary);
}

.key-status.not-configured {
  color: var(--warning);
}

/* Admin */
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
}

.admin-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9375rem;
  color: var(--gray-600);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.admin-toolbar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.search-input,
.filter-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.search-input {
  flex: 1;
  max-width: 300px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

.admin-table th {
  background: var(--gray-100);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  color: var(--gray-600);
}

.admin-table tbody tr:hover {
  background: var(--gray-50);
}

.settings-form {
  max-width: 600px;
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="number"] {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9375rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.tiers-list {
  display: grid;
  gap: 1rem;
}

.tier-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tier-card h4 {
  margin-bottom: 0.5rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-500);
}

.auth-form h2 {
  margin-bottom: 1.5rem;
}

.auth-switch {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.auth-switch a {
  color: var(--primary);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius);
  color: var(--white);
  animation: slideIn 0.3s ease;
  max-width: 350px;
}

.toast.success {
  background: var(--secondary);
}

.toast.error {
  background: var(--danger);
}

.toast.warning {
  background: var(--warning);
}

.toast.info {
  background: var(--primary);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--secondary);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-cta {
    flex-direction: column;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
  --gray-50: #111827;
  --gray-100: #1f2937;
  --gray-200: #374151;
  --gray-300: #4b5563;
  --gray-400: #6b7280;
  --gray-500: #9ca3af;
  --gray-600: #d1d5db;
  --gray-700: #e5e7eb;
  --gray-800: #f3f4f6;
  --gray-900: #f9fafb;
  --white: #1f2937;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3);
}

[data-theme="dark"] body {
  background: var(--gray-50);
  color: var(--gray-800);
}

[data-theme="dark"] .navbar {
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}

[data-theme="dark"] .editor {
  background: var(--gray-100);
  color: var(--gray-800);
}

[data-theme="dark"] .editor-toolbar {
  background: var(--gray-200);
  border-bottom-color: var(--gray-300);
}

[data-theme="dark"] .doc-title-input {
  color: var(--gray-800);
}

[data-theme="dark"] .doc-title-input:focus {
  background: var(--gray-100);
}

[data-theme="dark"] .modal-content {
  background: var(--gray-100);
}

[data-theme="dark"] .pricing-card,
[data-theme="dark"] .dashboard-card,
[data-theme="dark"] .document-card,
[data-theme="dark"] .feature-card {
  background: var(--gray-100);
}

[data-theme="dark"] .btn-outline {
  border-color: var(--gray-400);
  color: var(--gray-700);
}

[data-theme="dark"] .admin-table {
  background: var(--gray-100);
}

[data-theme="dark"] .admin-table th {
  background: var(--gray-200);
}

[data-theme="dark"] .settings-form {
  background: var(--gray-100);
}

[data-theme="dark"] input,
[data-theme="dark"] select {
  background: var(--gray-200);
  color: var(--gray-800);
  border-color: var(--gray-300);
}

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.theme-toggle:hover {
  background: var(--gray-200);
}

/* ============================================
   SEARCH
   ============================================ */
.search-container {
  position: relative;
  max-width: 400px;
}

.global-search {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background: var(--white);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 0.5rem;
}

.search-result-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background 0.2s;
}

.search-result-item:hover {
  background: var(--gray-50);
}

.search-result-item h4 {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.search-result-item .snippet {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.search-result-item .snippet mark {
  background: var(--warning);
  color: var(--gray-900);
  padding: 0 2px;
  border-radius: 2px;
}

/* ============================================
   FOLDERS / SIDEBAR
   ============================================ */
.documents-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .documents-layout {
    grid-template-columns: 1fr;
  }
}

.folder-sidebar {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow);
  height: fit-content;
}

.folder-sidebar h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 1rem;
}

.folder-tree {
  list-style: none;
}

.folder-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 0.25rem;
}

.folder-item:hover {
  background: var(--gray-100);
}

.folder-item.active {
  background: var(--primary);
  color: var(--white);
}

.folder-item .folder-icon {
  margin-right: 0.5rem;
}

.folder-item .folder-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--gray-400);
}

.folder-item.active .folder-count {
  color: rgba(255,255,255,0.7);
}

.new-folder-btn {
  width: 100%;
  margin-top: 1rem;
  justify-content: center;
}

/* ============================================
   TEMPLATES
   ============================================ */
.template-modal {
  max-width: 600px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.template-card {
  padding: 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.template-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.template-card .template-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.template-card h4 {
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.template-card p {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* ============================================
   KEYBOARD SHORTCUTS HINT
   ============================================ */
.shortcuts-hint {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  background: var(--gray-800);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  opacity: 0.8;
}

.shortcuts-hint kbd {
  background: var(--gray-600);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: monospace;
  margin: 0 0.125rem;
}

.shortcuts-modal {
  max-width: 500px;
}

.shortcuts-list {
  display: grid;
  gap: 0.5rem;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.shortcut-item kbd {
  background: var(--gray-100);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-family: monospace;
}

/* ============================================
   EXPORT MENU
   ============================================ */
.export-dropdown {
  position: relative;
}

.export-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 150px;
  z-index: 100;
  display: none;
}

.export-menu.active {
  display: block;
}

.export-menu-item {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.export-menu-item:hover {
  background: var(--gray-100);
}

/* ============================================
   MARKDOWN STYLES IN EDITOR
   ============================================ */
.editor h1 { font-size: 2rem; margin: 1rem 0 0.5rem; font-weight: 700; }
.editor h2 { font-size: 1.5rem; margin: 1rem 0 0.5rem; font-weight: 600; }
.editor h3 { font-size: 1.25rem; margin: 0.75rem 0 0.5rem; font-weight: 600; }
.editor h4 { font-size: 1.125rem; margin: 0.75rem 0 0.5rem; font-weight: 600; }
.editor h5 { font-size: 1rem; margin: 0.5rem 0; font-weight: 600; }
.editor h6 { font-size: 0.875rem; margin: 0.5rem 0; font-weight: 600; }

.editor ul, .editor ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.editor li {
  margin: 0.25rem 0;
}

.editor blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 1rem;
  margin: 0.5rem 0;
  color: var(--gray-600);
  font-style: italic;
}

.editor code {
  background: var(--gray-100);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: 'Fira Code', 'Monaco', monospace;
  font-size: 0.875em;
}

.editor pre {
  background: var(--gray-100);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 0.5rem 0;
}

.editor pre code {
  background: none;
  padding: 0;
}

.editor hr {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 1rem 0;
}

.editor a {
  color: var(--primary);
  text-decoration: underline;
}

.editor img {
  max-width: 100%;
  border-radius: var(--radius);
}

/* Task lists */
.editor input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* ============================================
   VOICE COMMAND INDICATOR
   ============================================ */
.voice-command-hint {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--gray-800);
  color: var(--white);
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
  font-size: 1.25rem;
  z-index: 1000;
  animation: fadeInOut 2s ease;
  pointer-events: none;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}

/* ============================================
   FOLDER HEADER AND ADDITIONAL STYLES
   ============================================ */
.folder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.folder-header h3 {
  margin-bottom: 0;
}

.folder-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.folder-item {
  border-left: 3px solid transparent;
}

.folder-delete {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.25rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.folder-item:hover .folder-delete {
  opacity: 1;
}

.folder-delete:hover {
  color: var(--danger);
}

.documents-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.documents-actions {
  display: flex;
  gap: 0.75rem;
}

.doc-folder {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-right: 0.5rem;
}

/* Export menu fix - show when not hidden */
.export-menu:not(.hidden) {
  display: block;
}

.export-option {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.export-option:hover {
  background: var(--gray-100);
}

/* Modal sizes */
.modal-lg {
  max-width: 600px;
}

.modal-sm {
  max-width: 350px;
}

/* Template grid responsive */
@media (max-width: 500px) {
  .template-grid {
    grid-template-columns: 1fr;
  }
}

.template-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.template-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.template-desc {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Shortcuts modal styles */
.shortcut-category {
  margin-bottom: 1.5rem;
}

.shortcut-category h4 {
  font-size: 0.875rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.shortcuts-list kbd {
  background: var(--gray-100);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: monospace;
  border: 1px solid var(--gray-200);
  margin: 0 0.125rem;
}

.shortcut-item span {
  color: var(--gray-600);
}

/* Search result title and snippet */
.search-result-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.search-result-snippet {
  font-size: 0.75rem;
  color: var(--gray-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-no-results {
  padding: 1rem;
  text-align: center;
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* Voice toggle active state */
#voiceToggle.active {
  background: var(--danger);
  color: white;
}

#voiceToggle.active .mic-icon {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Form color input */
input[type="color"] {
  width: 50px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  cursor: pointer;
}

/* Dark mode for new elements */
[data-theme="dark"] .folder-sidebar {
  background: var(--gray-100);
}

[data-theme="dark"] .template-card {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

[data-theme="dark"] .export-option:hover,
[data-theme="dark"] .search-result-item:hover {
  background: var(--gray-200);
}

[data-theme="dark"] .shortcuts-list kbd {
  background: var(--gray-200);
  border-color: var(--gray-300);
}
