/* Main Dashboard Component Styles */

/* CSS Variables for consistent theming */
:root {
  /* Color Palette - Professional Dark Theme */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --bg-active: #475569;

  /* Accent Colors */
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-secondary: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-inverse: #1e293b;

  /* Border Colors */
  --border-primary: #334155;
  --border-secondary: #475569;
  --border-accent: #3b82f6;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --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);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Transitions */
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dashboard Layout */
.dashboard {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-primary);
}

/* Main Content */
.mainContent {
  flex: 1;
  margin-left: 280px;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.mainContent.collapsed {
  margin-left: 80px;
}

/* Top Bar */
.topBar {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  padding: var(--spacing-lg) var(--spacing-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  height: 80px;
}

.topBarLeft {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.pageTitle {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.topBarRight {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.userProfile {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.userAvatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden; /* Ensures image respects circular boundary */
}

.userAvatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%; /* Double security for circular shape */
}
.userName {
  font-weight: 500;
  color: var(--text-primary);
}

/* Mobile Menu Button */
.mobileMenuBtn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.mobileMenuBtn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* Content Area */
.content {
  flex: 1;
  overflow-y: auto;
  background-color: var(--bg-primary);
}

/* Loading State */
.loadingContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.loadingSpinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-primary);
  border-top: 3px solid var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: var(--spacing-lg);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .mainContent {
    margin-left: 0;
  }

  .mainContent.collapsed {
    margin-left: 0;
  }

  .mobileOnly {
    display: flex !important;
  }

  .topBar {
    padding: var(--spacing-md) var(--spacing-lg);
  }

  .pageTitle {
    font-size: 1.25rem;
  }

  .userProfile {
    gap: var(--spacing-sm);
  }

  .userName {
    display: none;
  }
}

@media (min-width: 769px) {
  .mobileOnly {
    display: none !important;
  }
}
