/* Enable single-finger touch pan on mobile for mind map */
#mindmap-container svg {
  touch-action: none;
}

#mindmapCountContainer {
  display: flex;
  justify-content: center;
  align-items: center;
}

.mindmap-count-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: 20px;
  padding: 15px 25px;
  color: #333;
}

.info-menu {
  position: fixed;
  bottom: 70px;
  right: 20px;
  background-color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  z-index: 1800;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transform: translate(40px, 40px) scale(0.85) rotate(8deg);
  filter: blur(4px);
  transition: 
    opacity 400ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 500ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 350ms cubic-bezier(0.16, 1, 0.3, 1),
    visibility 400ms;
  pointer-events: none;
}

.info-menu.show {
  visibility: visible;
  opacity: 1;
  transform: translate(0, 0) scale(1) rotate(0deg);
  filter: blur(0px);
  pointer-events: auto;
}

.info-menu a {
   color: var(--text-color);
   text-decoration: none;
   padding: 8px 15px;
   border-radius: 12px;
   transition: background-color 0.3s ease;
   white-space: nowrap;
   display: flex;
   align-items: center;
}

.info-menu a:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.theme-toggle-button .theme-icon {
  margin-right: 8px;
}

/* Dark mode support for info-menu */
:root[data-theme="dark"] .info-menu,
:root.dark-mode .info-menu {
  background-color: #2a2d2e;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] .info-menu a:hover,
:root.dark-mode .info-menu a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not(.light-mode) .info-menu {
    background-color: #2a2d2e;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  }

  :root:not([data-theme="light"]):not(.light-mode) .info-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
}

.progress-circle {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
}


.progress-ring-track,
.progress-ring-progress {
  transition: stroke-dasharray 0.35s ease-out;
}

.progress-ring-track {
  stroke: #e0e0e0;
}

.progress-ring-progress {
  stroke: #68c76c;
}

.count-text {
  position: absolute;
  font-size: 1.8em;
  font-weight: bold;
  color: var(--text-color);
}

.count-label {
  font-size: 0.9em;
  color: var(--text-color);
  text-align: center;
  margin-top: 5px;
}


@media (max-width: 800px) {
    .nav-links.nav-links.padding-right {
        padding-right: 60px !important;
    }
}

.clear-history-button:hover {
  background-color: rgb(255, 229, 227) !important;
}

.clear-history-button {
  display: inline-flex; 
  align-items: center; 
  color: crimson !important;
  text-decoration: none; 
}


.keyboard-shortcuts-popup {
    position: fixed;
    background-color: #fff;
    border-radius: 20px;
    border: none;
    padding: 32px;
    bottom: 160px;
    right: 180px;
    z-index: 3200;
    width: 380px;
    max-width: 90vw;
    transform: translateY(0);
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: none;
}

    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateX(30px) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translateX(0) scale(1);
        }
    }
    
    /* Popup styles - used by various popups */
    .popup-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px 20px 0 20px;
        margin-bottom: 28px;
    }

    .popup-header h3 {
        margin: 0;
        color: var(--text-color);
        font-size: 1.4em;
        font-weight: 600;
        letter-spacing: -0.025em;
    }

    .popup-close {
        background-color: var(--background-color);
        border: none;
        color: var(--text-color);
        cursor: pointer;
        padding: 8px;
        border-radius: 50%;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

/* Document Upload Styles */
.upload-preview {
    max-width: 500px;
    margin: 16px auto 0;
    padding: 12px 16px;
    background: var(--card-background, #f8f9fa);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    font-size: 0.9rem;
}

.upload-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted, #666);
}

.upload-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color, #e0e0e0);
    border-top-color: var(--primary-color, #FA790E);
    border-radius: 50%;
    animation: uploadspin 0.8s linear infinite;
}

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

.upload-success {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-color, #333);
}

.upload-file-info .char-count {
    color: var(--text-muted, #888);
    font-weight: 400;
    font-size: 0.85em;
}

.extracted-preview {
    color: var(--text-muted, #666);
    font-size: 0.85em;
    line-height: 1.4;
    margin: 4px 0;
    padding: 8px;
    background: rgba(0,0,0,0.03);
    border-radius: 6px;
    max-height: 80px;
    overflow: hidden;
}

.clear-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    color: var(--text-muted, #666);
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.clear-upload-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
    color: #dc3545;
}

.upload-error {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #dc3545;
}

.upload-error button {
    padding: 4px 12px;
    background: transparent;
    border: 1px solid #dc3545;
    border-radius: 4px;
    color: #dc3545;
    cursor: pointer;
    font-size: 0.85em;
}

.upload-doc-btn {
    display: flex !important;
    align-items: center;
    gap: 6px;
}

.info-button {
  position: fixed;
  bottom: 11px;
  right: 15px;
  display: flex;
  align-items: center;
  background-color: var(--background-color);
  border-radius: 25px;
  padding: 8px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.3s ease;
  z-index: 2000;
  cursor: pointer;
}

@media (hover: hover) {
  .info-button:hover {
    background-color: var(--card-background);
  }
}

@media (max-width: 640px), (pointer: coarse) {
  .info-button {
      background-color: rgba(247, 250, 252, 0.9);
      padding: 10px;
  }
  .mm-toolbar {
      display: none !important;
  }
}

/* Dark mode for mobile info-button */
@media (max-width: 640px), (pointer: coarse) {
  html.markmap-dark .info-button,
  [data-theme="dark"] .info-button {
    background-color: rgba(29, 32, 33, 0.9);
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .info-button {
    background-color: rgba(29, 32, 33, 0.9);
  }
}

.mm-toolbar {
  position: fixed;
  bottom: 0px;
  right: 11px;
  background-color: var(--white) !important;
  border: none !important;
  border-radius: 20px 20px 0px 0px !important;
  display: flex;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
  flex-direction: row; 
  padding: 4px 52px 13px 3px !important;
  z-index: 1000;
  gap: 0px !important;
}

.mm-toolbar-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  cursor: pointer;
  border-radius: 40px !important;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
  color: #555;
}

.mm-toolbar-item:hover {
  background-color: var(--white) !important;
  transform: translateY(0px) !important;
  color: var(--text-color);
}

html.markmap-dark .mm-toolbar-item:hover {
  background-color: var(--white);
  transform: translateY(0px) !important;
  color: var(--text-color);
}

.mm-toolbar-item.active {
  background-color: #d0d0d0;
  color: var(--text-color) !important;
}

html.markmap-dark .mm-toolbar-item.active {
  background-color: #666;
  color: #fff;
}

.mm-toolbar-item svg {
  width: 20px;
  height: 20px;
  color: var(--text-color) !important;
}

.mm-toolbar-brand {
  display: none !important;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid #eee;
  text-decoration: none;
  color: inherit;
  font-weight: bold;
  font-size: 15px;
  border-radius: 6px;
  transition: background-color 0.2s ease-in-out;
}

html.markmap-dark .mm-toolbar-brand {
  border-bottom-color: #444;
}

.mm-toolbar-brand:hover {
  background-color: #f0f0f0;
}

html.markmap-dark .mm-toolbar-brand:hover {
  background-color: #444;
}

.mm-toolbar-brand:not(:first-child), .mm-toolbar-item:not(:first-child) {
  margin-left: 0px !important;
}

