/* ==========================================================================
   NoteCraft - Global Design System & Main Layout
   ========================================================================== */

:root {
  /* Light Theme Palette */
  --bg-app: #f8fafc;
  --bg-sidebar: #f1f5f9;
  --bg-sidebar-hover: #e2e8f0;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-toolbar: rgba(255, 255, 255, 0.92);
  --border-color: #e2e8f0;
  --border-subtle: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --accent-primary: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #eff6ff;

  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --success: #10b981;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-float: 0 12px 28px rgba(0, 0, 0, 0.15);

  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;

  --sidebar-width: 280px;
  --header-height: 56px;
  --toolbar-height: 48px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --paper-bg: #ffffff;
  --paper-line-color: rgba(203, 213, 225, 0.7);
  --paper-grid-color: rgba(203, 213, 225, 0.5);
  --paper-dot-color: rgba(148, 163, 184, 0.6);
}

/* Dark Theme Palette */
body.theme-dark {
  --bg-app: #090d16;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-card: #131b2e;
  --bg-input: #1e293b;
  --bg-toolbar: rgba(19, 27, 46, 0.92);
  --border-color: #1e293b;
  --border-subtle: #334155;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --accent-primary: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: rgba(59, 130, 246, 0.15);

  --danger: #f87171;
  --danger-light: rgba(239, 68, 68, 0.2);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-float: 0 12px 28px rgba(0, 0, 0, 0.6);

  --paper-bg: #131b2e;
  --paper-line-color: rgba(51, 65, 85, 0.8);
  --paper-grid-color: rgba(51, 65, 85, 0.6);
  --paper-dot-color: rgba(71, 85, 105, 0.8);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Common UI Elements */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  outline: none;
  color: inherit;
  transition: all 0.15s ease-in-out;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.btn-icon:hover {
  background-color: var(--bg-sidebar-hover);
  color: var(--text-primary);
}

.btn-icon.text-danger:hover {
  background-color: var(--danger-light);
  color: var(--danger);
}

.text-amber {
  color: #f59e0b !important;
}

.text-danger {
  color: var(--danger) !important;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Sidebar Layout
   ========================================================================== */

.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s ease;
  z-index: 50;
}

.sidebar.collapsed {
  width: 0;
  overflow: hidden;
  border-right: none;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-color);
}

.workspace-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}

.app-logo {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-search {
  padding: 12px 14px 6px;
  position: relative;
  display: flex;
  align-items: center;
}

.sidebar-search .search-icon {
  position: absolute;
  left: 26px;
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.sidebar-search input {
  width: 100%;
  padding: 8px 30px 8px 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sidebar-search input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.btn-clear {
  position: absolute;
  right: 22px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.sidebar-actions {
  padding: 8px 14px;
}

.btn-primary-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  background: var(--accent-primary);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s, transform 0.05s;
}

.btn-primary-action:hover {
  background-color: var(--accent-hover);
}

.btn-primary-action:active {
  transform: scale(0.98);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-icon {
  font-size: 0.82rem;
}

.doc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9rem;
  user-select: none;
  transition: background-color 0.12s, color 0.12s;
  position: relative;
}

.doc-item:hover {
  background-color: var(--bg-sidebar-hover);
  color: var(--text-primary);
}

.doc-item.active {
  background-color: var(--accent-light);
  color: var(--accent-primary);
  font-weight: 600;
}

.doc-item-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.doc-item-emoji {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.doc-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.doc-item-actions {
  display: none;
  align-items: center;
  gap: 4px;
}

.doc-item:hover .doc-item-actions {
  display: flex;
}

.doc-action-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.doc-action-btn:hover {
  background-color: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}

.sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  background-color: var(--bg-sidebar-hover);
}

.footer-btn:hover {
  color: var(--text-primary);
  background-color: var(--border-subtle);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-app);
}

.content-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 40;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 250px;
}

.doc-title-breadcrumb {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mode Selector Tabs */
.view-mode-selector {
  display: flex;
  align-items: center;
  background-color: var(--bg-sidebar);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.mode-btn:hover {
  color: var(--text-primary);
}

.mode-btn.active {
  background-color: var(--bg-card);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.save-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-right: 8px;
}

.save-indicator.saving {
  color: var(--accent-primary);
}

/* ==========================================================================
   Workspace Body & Note Viewport
   ========================================================================== */

.workspace-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.note-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 30px 20px 80px;
  display: flex;
  justify-content: center;
  background-color: var(--bg-app);
}

.note-paper-container {
  width: 100%;
  max-width: 860px;
  min-height: 1050px;
  background-color: var(--paper-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 48px 56px;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  transition: background-color 0.2s;
}

/* Note Header (Title & Emoji) */
.note-page-header {
  margin-bottom: 24px;
}

.page-emoji-selector {
  font-size: 2.8rem;
  line-height: 1;
  cursor: pointer;
  display: inline-block;
  user-select: none;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: transform 0.1s, background-color 0.15s;
}

.page-emoji-selector:hover {
  background-color: var(--bg-sidebar-hover);
  transform: scale(1.08);
}

.note-title-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 14px;
  outline: none;
  font-family: inherit;
  line-height: 1.25;
}

.note-title-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.note-meta {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Dual Layers */
.note-content-layers {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 600px;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

.emoji-modal-content {
  position: relative;
  width: 360px;
  max-height: 400px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  z-index: 10;
  padding: 16px;
}

.emoji-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 12px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  overflow-y: auto;
  max-height: 300px;
  padding: 4px;
}

.emoji-btn {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.1s, transform 0.1s;
}

/* Google Auth Widget & Cloud Styles */
.cloud-auth-widget {
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-google {
  color: #ea4335 !important;
}

.google-login-modal-content {
  position: relative;
  width: 400px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  z-index: 10;
  padding: 24px;
}

.google-login-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.google-brand-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.google-login-subtitle {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 16px;
}

/* Click-to-Login Account Cards */
.account-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.account-card-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-sidebar);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.account-card-item:hover {
  background: var(--accent-light);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.account-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.account-card-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.account-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.account-card-email {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-card-badge {
  font-size: 0.72rem;
  padding: 3px 7px;
  border-radius: var(--radius-full);
  background-color: var(--accent-primary);
  color: #ffffff;
  font-weight: 600;
  flex-shrink: 0;
}

.account-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin: 14px 0 10px;
}

.account-divider::before, .account-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.account-divider span {
  padding: 0 10px;
}

.btn-switch-account {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-switch-account:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-primary);
}

.quick-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.quick-account-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-sidebar);
  cursor: pointer;
  transition: all 0.12s;
  text-align: left;
}

.quick-account-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent-primary);
}

.quick-acc-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.quick-acc-info {
  flex: 1;
  min-width: 0;
}

.quick-acc-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.quick-acc-email {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.google-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.input-with-icon input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.input-with-icon input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.btn-google-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  margin-top: 6px;
  border-radius: var(--radius-sm);
  background: #4285f4;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-google-submit:hover {
  background: #3367d6;
}

.login-privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.login-privacy-note i {
  color: var(--success);
}

.btn-google-auth {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.btn-google-auth:hover {
  background-color: var(--bg-sidebar-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

.btn-google-auth i {
  color: #4285f4;
  font-size: 0.95rem;
}

.user-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-full);
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 2px 4px;
  border-radius: 4px;
}

.btn-logout:hover {
  color: var(--danger);
  background-color: var(--danger-light);
}

.header-divider-v {
  width: 1px;
  height: 20px;
  background-color: var(--border-color);
  margin: 0 4px;
}

/* Cloud Config Modal */
.cloud-modal-content {
  position: relative;
  width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  z-index: 10;
  padding: 24px;
}

.cloud-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cloud-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cloud-guide-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.config-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-input-group label {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.config-input-group textarea {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  resize: vertical;
  outline: none;
}

.config-input-group textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.cloud-status-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-sidebar);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.status-indicator-dot.online {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.cloud-modal-actions {
  display: flex;
  gap: 8px;
}

.btn-save-config {
  flex: 1;
  padding: 9px 16px;
  background: var(--accent-primary);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-save-config:hover {
  background: var(--accent-hover);
}

.btn-reset-config {
  padding: 9px 14px;
  background: var(--bg-sidebar);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.btn-reset-config:hover {
  background: var(--border-subtle);
  color: var(--text-primary);
}

.firebase-quick-guide {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.guide-step-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.guide-steps-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.45;
}

.guide-steps-list a {
  color: var(--accent-primary);
  font-weight: 600;
  text-decoration: none;
}

.guide-steps-list a:hover {
  text-decoration: underline;
}

.guide-steps-list code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 4px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.8em;
}

.emoji-btn:hover {
  background-color: var(--bg-sidebar-hover);
  transform: scale(1.15);
}

/* Mobile QR Modal */
.mobile-modal-content {
  position: relative;
  width: 400px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  z-index: 10;
  padding: 24px;
}

.mobile-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}

.modal-title-with-icon i {
  color: var(--accent-primary);
}

.mobile-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.qr-preview-box {
  background: #ffffff;
  padding: 12px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-guide-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.mobile-url-box {
  width: 100%;
  display: flex;
  gap: 6px;
}

.mobile-url-box input {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
}

.btn-copy-url {
  padding: 8px 14px;
  background: var(--accent-primary);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-copy-url:hover {
  background: var(--accent-hover);
}

.mobile-tips-box {
  width: 100%;
  text-align: left;
  background: var(--bg-sidebar);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.tip-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.tip-item {
  line-height: 1.4;
}

/* Header More Menu Dropdown */
.mobile-more-menu-wrapper {
  position: relative;
  display: none;
}

.header-more-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
  animation: fadeInDown 0.15s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.more-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.12s;
}

.more-item-btn:hover {
  background-color: var(--bg-sidebar-hover);
}

.more-item-btn i {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.more-item-btn.text-danger i {
  color: var(--danger);
}

.more-item-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 4px 6px;
}

/* ==========================================================================
   Responsive adjustments (Tablet & Mobile)
   ========================================================================== */

/* Tablet & Mobile Breakpoint (<= 992px) */
@media (max-width: 992px) {
  .content-header {
    padding: 0 12px;
    gap: 8px;
  }

  .breadcrumb {
    max-width: 150px;
  }

  .mode-btn {
    padding: 5px 10px;
    font-size: 0.82rem;
  }

  .note-paper-container {
    padding: 36px 32px;
  }
}

/* Mobile & Small Tablet Breakpoint (<= 768px) */
@media (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }

  .show-on-mobile {
    display: flex !important;
  }

  .content-header {
    height: 52px;
    padding: 0 10px;
  }

  .header-left, .header-right {
    gap: 6px;
  }

  .header-left {
    min-width: 0;
    flex-shrink: 1;
  }

  .breadcrumb {
    max-width: 110px;
    font-size: 0.84rem;
  }

  .doc-icon {
    display: none;
  }

  .header-center {
    flex-shrink: 0;
  }

  .view-mode-selector {
    padding: 2px;
    gap: 2px;
  }

  .mode-btn {
    padding: 5px 8px;
    font-size: 0.8rem;
    gap: 0;
  }

  .mode-btn i {
    font-size: 0.9rem;
  }

  .mode-label {
    display: none;
  }

  .btn-google-auth {
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  .btn-google-auth .auth-btn-label {
    display: none;
  }

  .user-profile-chip {
    padding: 2px 4px 2px 2px;
    gap: 4px;
  }

  .user-avatar {
    width: 24px;
    height: 24px;
  }

  .user-name {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    box-shadow: var(--shadow-lg);
    transform: translateX(0);
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }

  .note-viewport {
    padding: 10px 6px 50px;
  }

  .note-paper-container {
    padding: 20px 16px;
    min-height: calc(100vh - 120px);
    border-radius: var(--radius-sm);
  }

  .page-emoji-selector {
    font-size: 2.2rem;
  }

  .note-title-input {
    font-size: 1.5rem;
    margin-top: 8px;
  }

  .note-meta {
    font-size: 0.75rem;
  }
}

/* Print & PDF Export Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .sidebar,
  .content-header,
  .canvas-toolbar,
  .slash-menu,
  .format-toolbar,
  .modal,
  .block-handle,
  .btn-icon {
    display: none !important;
  }

  #app-container, .main-content, .workspace-body, .note-viewport {
    overflow: visible !important;
    height: auto !important;
    display: block !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .note-paper-container {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
}

