/* Sidebar container */
.sidebar {
  /* width: 15rem; */              /* Increased width - Removed for split.js */
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  border-right: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  padding: 0;                /* Remove all padding */
  position: relative;
  z-index: 50;
  margin-top: 0;
}

/* CSS variables for easy theming */
:root {
  --sidebar-bg: #121212;
  --sidebar-text: #ffffff;
  --sidebar-heading: #ffffff;
  --sidebar-date: #9e9e9e;
  --btn-bg: #242438;
  --btn-hover-bg: #2e2e4a;
  --selected-entry-bg: rgba(255, 255, 255, 0.05);
  --selected-entry-border: rgba(255, 255, 255, 0.1);
}

/* "New Entry" button area */
.sidebar-new-entry {
  padding: 1.25rem 1.5rem 1.35rem;  /* Reduced vertical padding */
}

.btn-new-entry {
  display: block;
  width: 100%;
  padding: 0.65rem 1.25rem;  /* Reduced vertical padding */
  background-color: var(--btn-bg);
  color: var(--sidebar-text);
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
  letter-spacing: 0.025em;
}
.btn-new-entry:hover {
  background-color: var(--btn-hover-bg);
}

/* Entries list container */
.sidebar-entries {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.75rem;        /* Increased horizontal padding */
}

/* Single entry */
.entry {
  padding: 0.85rem 0;         /* Reduced vertical padding */
  margin: 0.15rem 0;          /* Reduced vertical margins */
}
.entry--with-border {
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 1rem;       /* Reduced padding at bottom */
  margin-bottom: 0.25rem;     /* Reduced margin at bottom */
}

/* Entry link */
.entry__link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: opacity 0.2s ease;
  padding: 0.75rem 1rem;
  margin-left: 0.15rem;
  border-radius: 6px;
}

.entry__link:hover {
  opacity: 0.8;
  background-color: var(--selected-entry-bg);
}

.entry__link.selected {
  opacity: 0.8;
  background-color: var(--selected-entry-bg);
}

/* Entry title */
.entry__title {
  margin: 0 0 0.35rem 0;      /* Reduced bottom margin */
  font-size: 1.25rem;         /* Slightly reduced font size */
  font-weight: 700;
  color: var(--sidebar-heading);
  line-height: 1.25;          /* Reduced line height */
  letter-spacing: 0.015em;
}

/* Entry date */
.entry__date {
  font-size: 0.9rem;
  color: var(--sidebar-date);
  margin-left: 0.25rem;
  letter-spacing: 0.04em;
  display: inline-block;
  margin-top: 0.05rem;        /* Reduced top margin */
}

/* Loader */
.loader {
  display: flex;
  justify-content: center;
  padding: 1rem 0;            /* Reduced vertical padding */
}
.loader::before {
  content: "";
  width: 1.75rem;              /* Reduced from 2rem */
  height: 1.75rem;             /* Reduced from 2rem */
  border: 3px solid var(--sidebar-date);  /* Reduced from 4px */
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Empty state */
.sidebar-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sidebar-date);
  padding: 1.5rem 2.5rem;     /* Reduced vertical padding, kept horizontal */
  letter-spacing: 0.025em;
  font-size: 1.1rem;
}

/* Hidden class for the loader */
.hidden {
  display: none;
}

/* Spinner keyframes */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.close-sidebar-btn {
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  background: none !important;
  border: none !important;
  color: white !important;
  cursor: pointer !important;
  padding: 8px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background-color 0.2s ease !important;
  z-index: 1000 !important;
}

.close-sidebar-btn:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.open-sidebar-btn {
  position: fixed !important;
  top: 20px !important;
  left: 20px !important;
  background: var(--sidebar-bg) !important;
  border: none !important;
  color: white !important;
  cursor: pointer !important;
  padding: 8px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background-color 0.2s ease !important;
  z-index: 1000 !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.open-sidebar-btn:hover {
  background-color: var(--btn-hover-bg) !important;
}
