/* Modern Navigation Styles for Entrepreneur Dashboard
   Enhanced for accessibility, clean layout, and modern aesthetic
*/

:root {
  /* Modern color palette */
  --primary: #4361ee;
  --primary-light: #4895ef;
  --primary-dark: #3f37c9;
  --secondary: #6c757d;
  --success: #4cc9b0;
  --danger: #f72585;
  --warning: #ffc107;
  --info: #4cc9f0;
  --light: #f8f9fa;
  --dark: #212529;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  
  /* Layout measurements */
  --header-height: 70px;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 70px;
  
  /* Transition speeds */
  --transition-speed: 0.3s;
  
  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Border radius */
  --radius-sm: 0.2rem;
  --radius: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;
}

/* General body styling for entrepreneur interface */
body.entrepreneur-body {
  font-family: var(--font-sans);
  background-color: #f5f8fa;
  margin: 0;
  padding: 0;
  color: var(--gray-800);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ========== MODERN HEADER/NAVBAR ========== */
.modern-header {
  height: var(--header-height);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  box-shadow: var(--shadow);
  z-index: 1030;
  transition: all var(--transition-speed);
}

.header-container {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1.5rem;
}

/* Branding section with logo */
.header-brand {
  display: flex;
  align-items: center;
  width: var(--sidebar-width);
  padding-right: 1.5rem;
  transition: width var(--transition-speed);
}

.brand-logo {
  height: 36px;
  margin-right: 0.75rem;
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  transition: opacity var(--transition-speed);
}

/* Main navbar section */
.navbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
}

/* Left side with toggle and search */
.navbar-left {
  display: flex;
  align-items: center;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: none;
  background-color: transparent;
  color: var(--gray-700);
  margin-right: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.sidebar-toggle:hover, 
.sidebar-toggle:focus {
  background-color: var(--gray-100);
  color: var(--primary);
}

.navbar-search {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  height: 38px;
  width: 240px;
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-full);
  background-color: var(--gray-100);
  font-size: 0.875rem;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
  border-color: var(--primary-light);
  background-color: #fff;
  width: 280px;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--gray-500);
  pointer-events: none;
}

/* Right side with notifications and user menu */
.navbar-right {
  display: flex;
  align-items: center;
}

.navbar-tools {
  display: flex;
  align-items: center;
  margin-right: 1rem;
}

.navbar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: none;
  background-color: transparent;
  color: var(--gray-700);
  margin-left: 0.5rem;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s;
}

.navbar-icon-btn:hover,
.navbar-icon-btn:focus {
  background-color: var(--gray-100);
  color: var(--primary);
}

.notification-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  height: 18px;
  min-width: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background-color: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-menu {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius);
  transition: background-color 0.2s;
}

.user-menu:hover {
  background-color: var(--gray-100);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--gray-200);
  margin-right: 0.75rem;
}

.user-info {
  margin-right: 0.5rem;
}

.user-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--gray-900);
  line-height: 1.2;
}

.user-role {
  font-size: 0.75rem;
  color: var(--gray-600);
}

.dropdown-toggle {
  color: var(--gray-500);
  transition: color 0.2s;
}

.user-menu:hover .dropdown-toggle {
  color: var(--gray-700);
}

/* ========== MODERN SIDEBAR ========== */
.modern-sidebar {
  position: fixed;
  left: 0;
  top: var(--header-height);
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background-color: #fff;
  box-shadow: 1px 0 2px rgba(0, 0, 0, 0.05);
  z-index: 1020;
  overflow-y: auto;
  transition: width var(--transition-speed), transform var(--transition-speed);
}

.sidebar-wrapper {
  padding: 1.25rem 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-section-title {
  padding: 0 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
}

.nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin-bottom: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: var(--gray-700);
  font-size: 0.9375rem;
  text-decoration: none;
  border-radius: 0;
  transition: all 0.2s;
  position: relative;
}

.nav-link:hover {
  color: var(--primary);
  background-color: rgba(67, 97, 238, 0.05);
}

.nav-link.active {
  color: var(--primary);
  background-color: rgba(67, 97, 238, 0.1);
  font-weight: 500;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--primary);
}

.nav-icon {
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.875rem;
  transition: margin var(--transition-speed);
}

.nav-text {
  white-space: nowrap;
  opacity: 1;
  transition: opacity var(--transition-speed);
}

.nav-badge {
  margin-left: auto;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--primary);
  color: white;
  transition: opacity var(--transition-speed);
}

/* Collapsible sub-menu */
.submenu-collapse {
  height: 0;
  overflow: hidden;
  transition: height 0.35s ease;
}

.submenu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.submenu-item {
  margin-bottom: 1px;
}

.submenu-link {
  display: flex;
  align-items: center;
  padding: 0.625rem 1.75rem 0.625rem 3.25rem;
  color: var(--gray-600);
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s;
  border-radius: 0;
}

.submenu-link:hover {
  color: var(--primary);
  background-color: rgba(67, 97, 238, 0.05);
}

.submenu-link.active {
  color: var(--primary);
  font-weight: 500;
}

/* Profile section at the bottom */
.sidebar-profile {
  margin-top: auto;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--gray-200);
  margin-right: 0.75rem;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--gray-900);
  margin-bottom: 0.125rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.profile-status {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  color: var(--gray-600);
}

.status-badge {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--success);
  margin-right: 0.375rem;
}

/* ========== SIDEBAR COLLAPSED STATE ========== */
body.sidebar-collapsed .header-brand {
  width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .brand-text {
  opacity: 0;
}

body.sidebar-collapsed .modern-sidebar {
  width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-section-title,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-badge {
  opacity: 0;
}

body.sidebar-collapsed .nav-link {
  padding: 0.75rem;
  justify-content: center;
}

body.sidebar-collapsed .nav-icon {
  margin-right: 0;
}

body.sidebar-collapsed .sidebar-profile {
  padding: 1rem;
  justify-content: center;
}

body.sidebar-collapsed .profile-info {
  display: none;
}

body.sidebar-collapsed .profile-avatar {
  margin-right: 0;
}

body.sidebar-collapsed .submenu-collapse,
body.sidebar-collapsed .sidebar-section-title {
  display: none;
}

/* ========== MAIN CONTENT AREA ========== */
.modern-content {
  padding-top: var(--header-height);
  padding-left: var(--sidebar-width);
  transition: padding var(--transition-speed);
  min-height: 100vh;
}

body.sidebar-collapsed .modern-content {
  padding-left: var(--sidebar-collapsed-width);
}

.content-wrapper {
  padding: 1.5rem;
  width: 100%;
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */
@media (max-width: 992px) {
  .modern-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  
  .modern-content {
    padding-left: 0;
  }
  
  body.sidebar-expanded .modern-sidebar {
    transform: translateX(0);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  }
  
  body.sidebar-expanded .content-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1010;
  }
  
  .navbar-search {
    display: none;
  }
  
  .header-brand {
    width: auto;
  }
  
  .brand-text {
    display: none;
  }
  
  .user-info {
    display: none;
  }
  
  .user-avatar {
    margin-right: 0;
  }
}

@media (max-width: 576px) {
  .navbar-tools {
    margin-right: 0.5rem;
  }
  
  .navbar-icon-btn {
    width: 34px;
    height: 34px;
  }
  
  .user-avatar {
    width: 34px;
    height: 34px;
  }
}

/* ========== ACCESSIBILITY ENHANCEMENTS ========== */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  height: 40px;
  padding: 0.5rem 1rem;
  background-color: var(--primary);
  color: white;
  font-weight: 500;
  z-index: 1050;
  transition: top 0.2s;
}

.skip-to-content:focus {
  top: 0;
}

/* High contrast mode adjustments */
@media (forced-colors: active) {
  .nav-link.active::before {
    background-color: LinkText;
  }
  
  .status-badge {
    border: 1px solid CanvasText;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
