/* Modern Sidebar Navigation Styles */

/* Reduce sidebar width for less dead space */
.book-menu {
  flex: 0 0 14rem !important;
  background: #ffffff;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.08);
  border-right: 1px solid #e0e0e0;
  transition: all 0.3s ease;
}

.book-menu nav {
  width: 14rem !important;
  background: transparent;
}

/* Brand/Logo area styling */
.book-brand {
  padding: 1rem 0.875rem;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 0.75rem;
}

.book-brand a {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.book-brand img {
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
  filter: none;
  transition: transform 0.3s ease;
  background: transparent !important;
}

.book-brand:hover img {
  transform: scale(1.05);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.book-brand span {
  color: #333 !important;
  font-weight: 600;
  font-size: 1rem !important;
}

/* Search box modern styling */
.book-search {
  margin: 0.75rem 0 !important;
}

.book-search input {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  color: #333;
  padding: 0.625rem 0.875rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-size: 0.875rem;
}

.book-search input::placeholder {
  color: #999;
}

.book-search input:focus {
  background: #fff;
  border-color: #667eea;
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Menu items modern styling */
.book-menu nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.book-menu nav ul li {
  margin: 0.2rem 0;
}

.book-menu nav ul a {
  display: block;
  padding: 0.625rem 0.875rem;
  color: #555;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  font-weight: 500;
  font-size: 0.875rem;
}

/* Hover effect with sliding background */
.book-menu nav ul a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(102, 126, 234, 0.08);
  transition: left 0.3s ease;
  z-index: -1;
}

.book-menu nav ul a:hover::before {
  left: 0;
}

.book-menu nav ul a:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.08);
  transform: translateX(3px);
}

/* Active page styling */
.book-menu nav ul a.active,
.book-menu nav ul a[aria-current="page"] {
  background: #667eea;
  color: #fff;
  font-weight: 600;
  border-left: 3px solid #764ba2;
  padding-left: 1rem;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Nested menu items */
.book-menu nav ul ul {
  margin-left: 0.375rem;
  padding-left: 0.375rem;
  border-left: 2px solid #e0e0e0;
}

.book-menu nav ul ul a {
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
  color: #666;
}

/* Section headers */
.book-section-flat > a,
.book-section-flat > span {
  color: #333;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  padding: 0.75rem 0.875rem 0.375rem;
  display: block;
  font-weight: 700;
  opacity: 0.8;
}

/* Collapsible sections indicator */
.book-menu label {
  color: #555;
  cursor: pointer;
  padding: 0.625rem 0.875rem;
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-size: 0.875rem;
}

.book-menu label:hover {
  background: rgba(102, 126, 234, 0.08);
  color: #667eea;
}

/* Chevron/arrow for expandable sections */
.book-menu label::after {
  content: '›';
  margin-left: auto;
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.book-menu input[type="checkbox"]:checked + label::after {
  transform: rotate(90deg);
}

/* Scrollbar styling for modern look */
.book-menu nav::-webkit-scrollbar {
  width: 6px;
}

.book-menu nav::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 10px;
}

.book-menu nav::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 10px;
  transition: background 0.3s ease;
}

.book-menu nav::-webkit-scrollbar-thumb:hover {
  background: #b0b0b0;
}

/* Icons for menu items (if using Font Awesome or similar) */
.book-menu nav ul a i,
.book-menu nav ul a svg {
  margin-right: 0.75rem;
  opacity: 0.7;
  width: 1.25rem;
  display: inline-block;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .book-menu {
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
  }
  
  #menu-control:checked ~ main .book-menu nav {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
  }
}

/* Wider screens - optimize sidebar width */
@media screen and (min-width: 1400px) {
  .book-menu {
    flex: 0 0 13rem !important;
  }
  
  .book-menu nav {
    width: 13rem !important;
  }
}

/* Very wide screens - even more compact */
@media screen and (min-width: 1920px) {
  .book-menu {
    flex: 0 0 12rem !important;
  }
  
  .book-menu nav {
    width: 12rem !important;
  }
  
  .book-menu nav ul a {
    padding: 0.6rem 0.875rem;
    font-size: 0.85rem;
  }
}

/* Logo image fixes */
.book-brand img {
  background-color: transparent !important;
  background-image: none !important;
  background: none !important;
}

/* Ensure logo works with PNG transparency */
.book-brand img[src$=".png"] {
  mix-blend-mode: normal;
}

/* Animation for menu items */
.book-menu nav ul li {
  animation: slideInLeft 0.3s ease forwards;
  opacity: 0;
}

.book-menu nav ul li:nth-child(1) { animation-delay: 0.1s; }
.book-menu nav ul li:nth-child(2) { animation-delay: 0.15s; }
.book-menu nav ul li:nth-child(3) { animation-delay: 0.2s; }
.book-menu nav ul li:nth-child(4) { animation-delay: 0.25s; }
.book-menu nav ul li:nth-child(5) { animation-delay: 0.3s; }
.book-menu nav ul li:nth-child(n+6) { animation-delay: 0.35s; }

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Badge/counter styling for menu items */
.book-menu .badge {
  background: rgba(102, 126, 234, 0.15);
  color: #667eea;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  margin-left: 0.5rem;
  font-weight: 600;
}

/* Divider between sections */
.book-menu hr {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 1.5rem 0;
}

/* Mobile menu toggle button enhancement */
.book-header label {
  background: #667eea;
  color: white;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Tooltip effect for truncated text */
.book-menu nav ul a {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-menu nav ul a:hover {
  white-space: normal;
  overflow: visible;
}
