/* assets/css/style.css */

:root {
  --bs-body-bg: #121418;
  --bs-body-color: #e2e8f0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  letter-spacing: 0.3px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333b45; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #4a5568; }

.navbar { background-color: #1a1d24 !important; }
.custom-card { background-color: #1a1d24; }

.sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #1a1d24 !important; 
  border-bottom: 1px solid #2d333b !important;
  margin-bottom: 0.5rem;
}

#entries-pane .card {
  background-color: #21252d;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border: 1px solid #2d333b !important;
}
#entries-pane .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4) !important;
  border-color: #4a5568 !important;
}

/* --- AUDIT 15.2: Eindeutige visuelle Sperre für deaktivierte Buttons --- */
#entries-pane .btn:disabled {
    opacity: 0.2 !important;
    cursor: not-allowed !important;
    background-color: transparent !important;
    border-color: transparent !important;
    pointer-events: auto !important; /* Zwingt den Browser, den Verboten-Cursor anzuzeigen */
}

#folders-pane ul { list-style-type: none; padding-left: 0; margin-bottom: 0; }
#folders-pane > ul { padding-left: 0; }
#folders-pane ul ul {
  border-left: 1px solid #333b45;
  margin-left: 11px; padding-left: 16px; margin-top: 4px;
}
#folders-pane li { margin-bottom: 6px; position: relative; }
#folders-pane ul ul li::before {
  content: ""; position: absolute; top: 14px; left: -16px; width: 12px; height: 1px; background-color: #333b45;
}
#folders-pane li > div {
  padding: 4px 6px; border-radius: 6px; transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
#folders-pane li > div:hover { background-color: rgba(255, 255, 255, 0.03); }
#folders-pane .form-check-input {
  width: 1.1em; height: 1.1em; margin-top: 0; background-color: #1a1d24; border-color: #4a5568; cursor: pointer;
}
#folders-pane .form-check-input:checked { background-color: #66b2ff; border-color: #66b2ff; }

.btn-toggle {
  width: 20px; height: 20px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #333b45; border-radius: 4px; background: #1a1d24; color: #a0aec0; font-weight: bold;
  font-size: 14px; line-height: 1; transition: all 0.2s ease; z-index: 1;
}
.btn-toggle:hover:not([disabled]) { background: #2d333b; color: #fff; border-color: #4a5568; }

.selected { font-weight: 600; color: #66b2ff; }
.badge { font-weight: 500; padding: 0.4em 0.6em; }

.entry-note {
  background-color: rgba(255, 255, 255, 0.02);
  border-left: 2px solid #4a5568;
  font-size: 0.85rem;
  color: #a0aec0;
  padding: 0.4rem 0.6rem;
  border-radius: 0 4px 4px 0;
  margin-top: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.tag-pro {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  border: 1px solid rgba(102, 178, 255, 0.25);
  background-color: rgba(102, 178, 255, 0.05);
  color: #a0aec0;
  padding: 0.2rem 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.tag-pro::before {
  content: '#';
  color: #4a5568;
  margin-right: 0.2rem;
  font-weight: 700;
  font-size: 0.8rem;
}
.tag-pro:hover {
  background-color: rgba(102, 178, 255, 0.15);
  border-color: rgba(102, 178, 255, 0.6);
  color: #e2e8f0;
}

.sidebar-tag-item {
  width: 100%;
  justify-content: space-between;
  margin-bottom: 0.3rem;
  padding: 0.3rem 0.5rem;
}
.sidebar-tag-count {
  font-family: 'Courier New', Courier, monospace;
  color: #718096;
  font-size: 0.75rem;
}
.tag-alpha-header {
  color: #4a5568;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 0.8rem;
  margin-bottom: 0.2rem;
  padding-left: 0.2rem;
  letter-spacing: 1px;
}
.tag-heatmap-hot {
  border-color: rgba(102, 178, 255, 0.6);
  background-color: rgba(102, 178, 255, 0.1);
}
.tag-active {
  border-left: 3px solid #66b2ff !important;
  color: #ffffff !important;
  background-color: rgba(102, 178, 255, 0.2) !important;
}

.entry-tags-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.6rem;
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag-pro-sm {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
}

.tag-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.375rem 0.75rem;
  background-color: #21252d;
  border: 1px solid #4a5568;
  border-radius: 6px;
  min-height: 42px;
  align-items: center;
  cursor: text;
}
.tag-input-wrapper:focus-within {
  border-color: #66b2ff;
  box-shadow: 0 0 0 0.25rem rgba(102, 178, 255, 0.25);
}
.tag-input-wrapper input {
  border: none;
  background: transparent;
  color: #e2e8f0;
  outline: none;
  flex-grow: 1;
  min-width: 120px;
  padding: 0.2rem 0;
}
.modal-tag-chip {
  display: flex;
  align-items: center;
  background-color: rgba(102, 178, 255, 0.15);
  border: 1px solid rgba(102, 178, 255, 0.4);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.85rem;
  color: #e2e8f0;
}
.modal-tag-chip .remove-tag {
  margin-left: 0.4rem;
  cursor: pointer;
  color: #a0aec0;
  opacity: 0.6;
  transition: all 0.2s ease;
  font-size: 1rem;
  line-height: 1;
}
.modal-tag-chip:hover .remove-tag {
  opacity: 1;
  color: #ff6b6b;
}
.autocomplete-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.drag-over {
  background-color: rgba(102, 178, 255, 0.15) !important;
  box-shadow: inset 0 0 0 2px #66b2ff !important;
}
.drag-over-top { position: relative; }
.drag-over-top::before {
  content: ""; position: absolute; top: -3px; left: 0; right: 0; height: 3px; 
  background: #66b2ff; border-radius: 3px; z-index: 10;
  box-shadow: 0 -2px 8px rgba(102, 178, 255, 0.6);
}
.drag-over-bottom { position: relative; }
.drag-over-bottom::after {
  content: ""; position: absolute; bottom: -3px; left: 0; right: 0; height: 3px; 
  background: #66b2ff; border-radius: 3px; z-index: 10;
  box-shadow: 0 2px 8px rgba(102, 178, 255, 0.6);
}
.drag-over-root {
  background-color: rgba(102, 178, 255, 0.03) !important;
  box-shadow: inset 0 0 0 2px rgba(102, 178, 255, 0.4) !important;
  border-radius: 6px;
}

.toggle-icon {
  display: inline-block;
  transition: transform 0.3s ease;
}
.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.main-link {
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  display: inline-block;
  max-width: 100%;
}

.drag-handle {
  opacity: 0.4;
  transition: opacity 0.2s ease, color 0.2s ease;
  touch-action: none;
}
.drag-handle:hover {
  opacity: 1;
  color: #fff !important;
}

#entries-pane .card:hover .entry-title-link {
  color: #66b2ff !important;
  text-decoration: underline !important;
}

.link-icon {
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
  font-size: 0.9rem;
}
#entries-pane .card:hover .link-icon {
  opacity: 1;
  color: #66b2ff !important;
}

@media (max-width: 991px) {
  .mobile-btn-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.5rem !important;
    width: 100%;
  }
  .mobile-btn-grid .nav-item {
    margin: 0 !important;
    width: 100%;
    display: flex;
  }
  .mobile-btn-grid .btn {
    padding: 0.6rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}