/* Dashboard Styling based on Behance design */

:root {
  --sidebar-bg: #ffffff;
  --sidebar-active: #7e57c2;
  --sidebar-hover: rgba(126, 87, 194, 0.1);
  --primary-color: #7e57c2;
  --secondary-color: rgba(126, 87, 194, 0.2);
  --text-dark: #333333;
  --text-light: #8798ad;
  --text-white: #ffffff;
  --card-bg: #ffffff;
  --body-bg: #f8f9ff;
  --success-green: #33ac2e;
  --warning-orange: #f7c137;
  --danger-red: #d63649;
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  --header-height: 70px;
  --border-radius: 12px;
}

/* General Layout */
body {
  background-color: var(--body-bg);
  color: var(--text-dark);
  font-family: 'Inter', 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) #f1f1f1;
}

/* Custom scrollbar for the entire page */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 10px;
}

/* Sidebar Styling */
#sidebar {
  background-color: var(--sidebar-bg);
  width: 250px;
  min-width: 250px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  transition: all 0.3s ease;
  z-index: 30;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.03);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) #f1f1f1;
}

#sidebar::-webkit-scrollbar {
  width: 6px;
}

#sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
}

#sidebar::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 10px;
}

.sidebar-logo-container {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background-color: var(--sidebar-bg);
}

.sidebar-logo {
  height: 60px;
  object-fit: contain;
  max-width: 100%;
}

.nav-section {
  padding: 5px 0;
}

.nav-section-title {
  color: var(--text-light);
  font-size: 13px;
  font-weight: 500;
  padding: 0 30px;
  margin-bottom: 10px;
  margin-top: 10px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--text-dark);
  transition: all 0.2s ease;
  margin: 5px 10px;
  border-radius: var(--border-radius);
  position: relative;
  font-weight: 500;
}

.sidebar-item:hover {
  background-color: var(--sidebar-hover);
  color: var(--primary-color);
}

.sidebar-item.active {
  color: var(--text-white);
  background-color: var(--sidebar-active);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 10px rgba(126, 87, 194, 0.3);
}

.sidebar-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-right: 12px;
  font-size: 16px;
  color: inherit;
  background-color: rgba(126, 87, 194, 0.1);
  border-radius: 8px;
  padding: 5px;
}

.sidebar-item.active .sidebar-icon {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 20px;
  width: 100%;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  width: calc(100% - 250px);
  min-height: 100vh;
  position: absolute;
  right: 0;
  top: 0;
  left: 250px;
  display: flex;
  flex-direction: column;
  background-color: var(--body-bg);
}

/* Header/Navbar */
.dashboard-header {
  height: var(--header-height);
  background-color: var(--card-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
}

.header-search {
  background-color: var(--body-bg);
  border-radius: 20px;
  padding: 8px 15px;
  display: flex;
  align-items: center;
  width: 300px;
}

.header-search input {
  background: transparent;
  border: none;
  outline: none;
  padding: 0 10px;
  width: 100%;
  color: var(--text-dark);
}

.header-search i {
  color: var(--text-light);
}

.user-profile {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--secondary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-blue);
  font-weight: bold;
  margin-right: 10px;
}

/* Dashboard Cards */
.stat-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  padding: 20px;
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(126, 87, 194, 0.1);
}

.stat-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  font-size: 20px;
}

.stat-card-title {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 5px;
}

.stat-card-value {
  color: var(--text-dark);
  font-size: 24px;
  font-weight: bold;
}

/* Compact Dashboard Cards */
.stat-card-compact {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  padding: 16px 20px;
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.03);
  min-height: 80px;
}

.stat-card-compact:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(126, 87, 194, 0.1);
}

.stat-card-icon-compact {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.stat-card-title-compact {
  color: var(--text-light);
  font-size: 13px;
  font-weight: 500;
  margin-top: 2px;
  line-height: 1.2;
}

.stat-card-value-compact {
  color: var(--text-dark);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

/* Action Cards */
.action-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  padding: 20px;
  height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.action-link {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border-radius: 8px;
  transition: all 0.2s ease;
  margin-bottom: 8px;
}

.action-link:hover {
  background-color: var(--body-bg);
}

.action-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

/* Table Styling */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  background-color: var(--body-bg);
  color: var(--text-light);
  font-weight: 500;
  text-align: left;
  padding: 12px 15px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Status Badges */
.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  display: inline-block;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.status-pending {
  background-color: var(--warning-orange);
  color: #fff;
}

.status-completed {
  background-color: var(--success-green);
  color: #fff;
}

.status-cancelled {
  background-color: var(--danger-red);
  color: #fff;
}

/* Hide mobile navigation on desktop */
#mobile-sidebar,
#sidebar-overlay {
  display: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  /* Show mobile navigation only on mobile */
  #mobile-sidebar,
  #sidebar-overlay {
    display: block;
  }

  #sidebar {
    transform: translateX(-100%);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .content-wrapper {
    left: 0;
    width: 100%;
  }

  .sidebar-open #sidebar {
    transform: translateX(0);
  }

  .header-search {
    width: 200px;
  }

  body.sidebar-open .content-wrapper {
    opacity: 0.5;
    pointer-events: none;
  }

  /* Mobile Sidebar Specific Styles */
  #mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    z-index: 1050;
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(126, 87, 194, 0.1);
  }

  /* Hidden state - completely invisible */
  #mobile-sidebar.sidebar-hidden {
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.6, 1);
  }

  /* Open state - slide in with fade */
  #mobile-sidebar.sidebar-open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
  }

  /* Animate sidebar items when opening */
  #mobile-sidebar .sidebar-item {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
    transition-delay: 0.1s;
  }

  #mobile-sidebar.sidebar-open .sidebar-item {
    opacity: 1;
    transform: translateX(0);
  }

  /* Stagger animation for sidebar items - only when opening */
  #mobile-sidebar.sidebar-open .sidebar-item:nth-child(1) {
    transition-delay: 0.1s;
  }

  #mobile-sidebar.sidebar-open .sidebar-item:nth-child(2) {
    transition-delay: 0.15s;
  }

  #mobile-sidebar.sidebar-open .sidebar-item:nth-child(3) {
    transition-delay: 0.2s;
  }

  #mobile-sidebar.sidebar-open .sidebar-item:nth-child(4) {
    transition-delay: 0.25s;
  }

  #mobile-sidebar.sidebar-open .sidebar-item:nth-child(5) {
    transition-delay: 0.3s;
  }

  #mobile-sidebar.sidebar-open .sidebar-item:nth-child(6) {
    transition-delay: 0.35s;
  }

  #mobile-sidebar.sidebar-open .sidebar-item:nth-child(7) {
    transition-delay: 0.4s;
  }

  #mobile-sidebar.sidebar-open .sidebar-item:nth-child(8) {
    transition-delay: 0.45s;
  }

  /* No delay when closing for snappy close */
  #mobile-sidebar.sidebar-hidden .sidebar-item {
    transition-delay: 0s;
  }

  /* Logo animation */
  #mobile-sidebar .sidebar-logo-container {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s ease;
    transition-delay: 0.05s;
  }

  #mobile-sidebar.sidebar-open .sidebar-logo-container {
    opacity: 1;
    transform: translateY(0);
  }

  /* Section titles animation */
  #mobile-sidebar .nav-section-title {
    opacity: 0;
    transform: translateX(-15px);
    transition: all 0.3s ease;
  }

  #mobile-sidebar.sidebar-open .nav-section-title {
    opacity: 1;
    transform: translateX(0);
  }

  /* Enhanced overlay with backdrop blur */
  #sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(126, 87, 194, 0.1));
    backdrop-filter: blur(5px);
    z-index: 1040;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
    visibility: hidden;
  }

  /* Hidden state for overlay */
  #sidebar-overlay.sidebar-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.6, 1);
  }

  /* Open state for overlay */
  #sidebar-overlay.sidebar-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Add subtle bounce effect to close button */
  #mobile-sidebar #close-sidebar {
    transition: all 0.2s ease;
  }

  #mobile-sidebar #close-sidebar:hover {
    transform: scale(1.1);
    color: var(--primary-color);
  }

  #mobile-sidebar #close-sidebar:active {
    transform: scale(0.95);
  }
}