/* Logo floats if sidebar is closed */
html:not([class]), /* matches when body has no class */
html:not(.sidebar-open) /* matches when body doesn't have sidebar-open class */ {
  .logo-button {
    animation: float 3s ease-in-out infinite;
  }
}

/* Add this if you need to override other animations */
html.sidebar-open .logo-button {
  animation: none;
}

:root {
  --sidebar-width: 250px;
}

/* Main content area */
.main-container {
  display: flex;
  flex: 1;
  min-height: 0; /* Important for Firefox */
  background: var(--content-background, #f5f5f7);
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: 0px;
  max-width: var(--sidebar-width);
  background: var(--background);
  border-right: 1px solid var(--border);
  overflow: hidden; /* Hide content when collapsed */
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.05);
  border-right: 1px solid rgba(0, 0, 0, 0.1);
}

html.sidebar-open .sidebar {
  width: var(--sidebar-width);
  overflow: visible;
}

/* Update sidebar content to enable scrolling for entry types */
.sidebar-content {
  padding: var(--base-spacing);
  padding-right: 0;
  width: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Add scrollable area for entry types */
.entry-types-list {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  margin-bottom: 1rem;
  /* Custom scrollbar: transparent background, black thumb */
}
.entry-types-list::-webkit-scrollbar {
  width: 8px;
  background: transparent;
}
.entry-types-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}
.entry-types-list::-webkit-scrollbar-track {
  background: transparent;
}
.entry-types-list {
  scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
  scrollbar-width: thin;
}

/* Fixed bottom section for utility links */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: auto;
}

.sidebar-footer a {
  opacity: 0.7;
}

/* Sidebar links */
.sidebar-content a {
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 6px;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-content a span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-content a:hover {
  background: var(--hover-background);
}

.sidebar-content a.selected {
  background: var(--selected-background, rgba(0, 0, 0, 0.08));
  font-weight: 500;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* Remove overlay styles since we're not using it anymore */

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  :root {
    --content-background: #1a1a1c;
  }

  #main-nav {
    border-bottom-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  }

  .sidebar {
    border-right-color: rgba(255, 255, 255, 0.1);
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.2);
  }

  .sidebar-content a {
    color: rgba(255, 255, 255, 0.9);
  }

  .sidebar-content a:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .sidebar-content a.selected {
    background: rgba(255, 255, 255, 0.1);
  }

  .sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
  }

  .group-header {
    color: rgba(255, 255, 255, 0.9);
  }
}

/* Entry Type Groups */

.group-header {
  color: var(--text);
  font-weight: 500;
  opacity: 0.7;
}

.group-header i {
  margin-right: 0.5rem;
}


.delete-button {
  opacity: 0;
}

.group-content {
  padding: calc(var(--base-spacing) / 2) 0;
}
.group-content:empty {
  display: none;
}

.entry-type-link,
.group-header,
.group-content {
  &:hover,
  &:focus {
    .delete-button {
      opacity: 1;
    }
  }
} 