/**
 * Ventur Sidebar CSS
 * Compact, professional sidebar styles inspired by Next.js dashboards
 */

/* Sidebar Container */
.ventur-sidebar {
  width: 16rem; /* 256px - more compact than the previous 288px */
  transition: transform 0.3s ease;
}

/* Sidebar Header */
.sidebar-header {
  min-height: 4rem;
}

/* Sidebar Items - Compact Design */
.sidebar-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem; /* Much smaller than the previous p-4 (1rem) */
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  gap: 1rem; /* Consistent spacing between icon and text */
}

.sidebar-item:hover {
  background-color: #F3F4F6;
  color: #111827;
}

/* Active State */
.sidebar-item-active {
  background: #111827; /* Clean black like Next.js */
  color: white !important;
  font-weight: 600;
}

.sidebar-item-active:hover {
  background: #000000; /* Slightly darker on hover */
  color: white;
}

/* Icon Styles */
.sidebar-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  stroke-width: 2;
}

/* Text */
.sidebar-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status Icons for app.html */
.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.status-icon .default-icon {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: 2px solid #D1D5DB;
}

.status-icon .spinner {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid rgba(0,0,0,.1);
  border-radius: 50%;
  border-top-color: #3B82F6;
  animation: spin 1s linear infinite;
}

.status-icon .success-icon {
  color: #10B981;
  font-weight: bold;
  font-size: 0.875rem;
  line-height: 1;
}

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

/* Footer Spacing */
.sidebar-footer {
  min-height: auto;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .ventur-sidebar {
    width: 16rem;
  }
}

/* Scrollbar Styling */
.ventur-sidebar::-webkit-scrollbar {
  width: 0.375rem;
}

.ventur-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.ventur-sidebar::-webkit-scrollbar-thumb {
  background: #E5E7EB;
  border-radius: 0.25rem;
}

.ventur-sidebar::-webkit-scrollbar-thumb:hover {
  background: #D1D5DB;
}

/* Main content adjustment */
.md\:ml-sidebar {
  margin-left: 0;
}

@media (min-width: 768px) {
  .md\:ml-sidebar {
    margin-left: 16rem;
  }
}

/* Group Headers */
.sidebar-group-header {
  padding: 0.75rem 0.75rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Separator */
.sidebar-separator {
  margin: 0.75rem 0;
  border-top: 1px solid #E5E7EB;
}

/* Badge for notifications/counts */
.sidebar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  background-color: #EF4444;
  border-radius: 9999px;
  margin-left: auto;
}

/* Company selector (for app.html) */
#current-company {
  font-size: 0.875rem;
}

/* Animation for sidebar items */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-0.5rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sidebar-item {
  animation: slideIn 0.2s ease-out;
}

/* Focus styles for accessibility */
.sidebar-item:focus {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

.sidebar-item:focus:not(:focus-visible) {
  outline: none;
}

/* Improve touch targets on mobile */
@media (max-width: 768px) {
  .sidebar-item {
    padding: 0.625rem 0.75rem;
  }
}
