/* =====================================================
   TehGuys Modern Theme
   Cinematic, High-Contrast, Premium Design System
   Supports Light & Dark modes
   ===================================================== */

/* =====================================================
   CSS Variables - Light Theme (Default)
   ===================================================== */
:root {
  /* Primary Light Palette */
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-tertiary: #fafafa;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f8f8;
  --bg-elevated: #ffffff;
  --bg-input: #f0f0f0;

  /* Surface Colors */
  --surface-dark: #e8e8e8;
  --surface-medium: #ebebeb;
  --surface-light: #f0f0f0;
  --surface-highlight: #f5f5f5;

  /* Border Colors */
  --border-dark: #e0e0e0;
  --border-medium: #d0d0d0;
  --border-light: #c0c0c0;
  --border-highlight: #b0b0b0;

  /* Text Colors */
  --text-primary: #1a1a1a;
  --text-secondary: #333333;
  --text-tertiary: #666666;
  --text-muted: #888888;
  --text-placeholder: #aaaaaa;

  /* Accent Colors */
  --accent-blue: #0d6efd;
  --accent-blue-hover: #0b5ed7;
  --accent-blue-glow: rgba(13, 110, 253, 0.2);
  --accent-red: #dc3545;
  --accent-green: #198754;
  --accent-yellow: #ffc107;
  --accent-purple: #6f42c1;

  /* Legacy vars for compatibility */
  --bg-color: #f5f5f7;
  --text-color: #1a1a1a;
  --card-bg: #ffffff;
  --footer-bg: #ffffff;
  --muted-color: #888888;
  --link-color: #0d6efd;
  --border-color: #d0d0d0;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 20px rgba(13, 110, 253, 0.1);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.12);

  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;

  /* Layout */
  --sidebar-width: 220px;
  --topbar-height: 60px;
  --content-max-width: 1400px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* =====================================================
   CSS Variables - Dark Theme Override
   ===================================================== */
body.dark-mode {
  /* Primary Dark Palette */
  --bg-primary: #0a0a0a;
  --bg-secondary: #0f0f0f;
  --bg-tertiary: #141414;
  --bg-card: #1a1a1a;
  --bg-card-hover: #1f1f1f;
  --bg-elevated: #222222;
  --bg-input: #181818;

  /* Surface Colors */
  --surface-dark: #0d0d0d;
  --surface-medium: #171717;
  --surface-light: #1e1e1e;
  --surface-highlight: #252525;

  /* Border Colors */
  --border-dark: #1a1a1a;
  --border-medium: #2a2a2a;
  --border-light: #333333;
  --border-highlight: #404040;

  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --text-tertiary: #a0a0a0;
  --text-muted: #666666;
  --text-placeholder: #555555;

  /* Legacy vars for compatibility */
  --bg-color: #0a0a0a;
  --text-color: #ffffff;
  --card-bg: #1a1a1a;
  --footer-bg: #0f0f0f;
  --muted-color: #666666;
  --border-color: #2a2a2a;

  /* Shadows - darker for dark mode */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 20px rgba(13, 110, 253, 0.15);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.5);
}

/* =====================================================
   Global Reset & Base Styles
   ===================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Bridge to Bootstrap variables */
  --bs-body-bg: var(--bg-primary);
  --bs-body-color: var(--text-primary);
  --bs-link-color: var(--link-color);
  --bs-border-color: var(--border-color);
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-blue-hover);
}

/* =====================================================
   Card Components
   ===================================================== */
.card, .list-group-item, .alert, .dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
}

.card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.card-header {
  background: var(--surface-dark);
  border-bottom: 1px solid var(--border-dark);
  padding: var(--space-lg);
  font-weight: 600;
}

.card-body {
  padding: var(--space-lg);
}

.card-footer {
  background: var(--surface-dark);
  border-top: 1px solid var(--border-dark);
  padding: var(--space-lg);
}

/* Text utilities */
.text-muted, small, .form-text {
  color: var(--text-muted) !important;
}

/* Footer */
footer {
  background-color: var(--footer-bg);
  color: var(--text-secondary);
}

/* Nav tabs/pills */
.nav-tabs .nav-link, .nav-pills .nav-link {
  color: var(--text-tertiary);
  border: none;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.nav-tabs .nav-link:hover, .nav-pills .nav-link:hover {
  color: var(--text-primary);
  background: var(--surface-light);
}

.nav-tabs .nav-link.active, .nav-pills .nav-link.active {
  background: var(--accent-blue);
  color: white;
}

/* Dropdown items */
.dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-sm);
}

.dropdown-menu .dropdown-item {
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.dropdown-menu .dropdown-item:hover, .dropdown-menu .dropdown-item:focus {
  background: var(--surface-light);
  color: var(--text-primary);
}

/* Forms */
.form-control,
.form-select,
.input-group-text,
textarea,
input[type="text"],
input[type="search"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="time"] {
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-medium) !important;
  border-radius: var(--radius-md) !important;
  padding: var(--space-md) !important;
  transition: all var(--transition-fast) !important;
}

.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus {
  outline: none !important;
  border-color: var(--accent-blue) !important;
  box-shadow: 0 0 0 3px var(--accent-blue-glow) !important;
}

.form-control::placeholder,
textarea::placeholder {
  color: var(--text-placeholder) !important;
}

.form-label {
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: var(--space-sm);
}

.form-check-label {
  color: var(--text-secondary);
}

.form-check-input {
  background-color: var(--bg-input);
  border-color: var(--border-medium);
}

.form-check-input:checked {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
}

/* Background utilities */
.bg-light {
  background-color: var(--surface-light) !important;
  color: var(--text-primary) !important;
}

.bg-white {
  background-color: var(--bg-card) !important;
  color: var(--text-primary) !important;
}

.text-dark {
  color: var(--text-primary) !important;
}

a.text-dark {
  color: var(--text-primary) !important;
}

/* Utils */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

/* =====================================================
   Modern Layout Structure - Right Sidebar
   ===================================================== */

/* Right Sidebar */
.app-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-dark);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition-base);
}

.app-sidebar-right {
  left: auto;
  right: 0;
  border-left: 1px solid var(--border-dark);
  border-right: none;
}

@media (min-width: 1200px) {
  .app-sidebar {
    width: calc(var(--sidebar-width) * 0.92);
  }
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
  font-size: 0.75rem;
}

.sidebar-toggle-btn:hover {
  background: var(--surface-light);
  color: var(--text-primary);
  border-color: var(--accent-blue);
}

/* Minimized Sidebar State */
  .app-sidebar.minimized {
    width: 60px;
    min-width: 0;
  }

.app-sidebar.minimized .sidebar-user-section,
.app-sidebar.minimized .nav-item span,
.app-sidebar.minimized .nav-badge,
.app-sidebar.minimized .user-profile-info,
.app-sidebar.minimized .user-dropdown-icon {
  display: none;
}

.app-sidebar.minimized .sidebar-controls {
  flex-direction: column;
  padding: var(--space-xs);
}

.app-sidebar.minimized .control-btn {
  width: 36px;
  height: 36px;
}

.app-sidebar.minimized .nav-item {
  justify-content: center;
  padding: var(--space-md);
}

.app-sidebar.minimized .nav-item i {
  margin: 0;
  font-size: 1.25rem;
}

.app-sidebar.minimized .nav-separator {
  margin: var(--space-sm);
}

.app-sidebar.minimized .sidebar-toggle-btn {
  position: relative;
  top: 0;
  right: 0;
  margin: var(--space-sm) auto;
}

.app-sidebar.minimized + .app-content {
  margin-right: 60px;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: var(--space-md) 0;
  overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-full);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
  transition: color var(--transition-fast);
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--surface-light);
}

.nav-item:hover i {
  color: var(--accent-blue);
}

.nav-item.active {
  color: var(--text-primary);
  background: linear-gradient(270deg, rgba(13, 110, 253, 0.15) 0%, transparent 100%);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  right: 0;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent-blue);
  border-radius: var(--radius-xs) 0 0 var(--radius-xs);
}

.nav-item.active i {
  color: var(--accent-blue);
}

.nav-separator {
  height: 1px;
  background: var(--border-dark);
  margin: var(--space-md) var(--space-lg);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-dark);
}

.logout-btn {
  color: var(--accent-red) !important;
}

.logout-btn:hover {
  background: rgba(220, 53, 69, 0.1) !important;
  color: var(--accent-red) !important;
}

/* Language Switcher */
.language-switcher {
  margin-top: var(--space-sm);
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  transition: all var(--transition-fast);
}

.lang-btn:hover {
  background: var(--surface-light);
  color: var(--text-primary);
}

.lang-btn i {
  font-size: 0.875rem;
}

/* Nav Badge */
.nav-badge {
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  background: var(--accent-blue);
  color: white;
  border-radius: 4px;
  margin-left: auto;
  font-weight: 700;
}

.collab-toggle.active {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
}

.collab-toggle.active i {
  color: #fbbf24;
}

/* Sidebar User Section */
.sidebar-user-section {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-dark);
}

.user-profile-card {
  margin-bottom: var(--space-md);
}

.user-profile-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
}

.user-profile-btn:hover {
  background: var(--surface-light);
  border-color: var(--accent-blue);
}

.sidebar-avatar,
.sidebar-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  object-position: center;
  background: var(--bg-primary);
  flex-shrink: 0;
}

.sidebar-avatar-placeholder {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.user-profile-info {
  flex: 1;
  text-align: left;
  min-width: 0;
}

.user-profile-name {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-profile-status {
  font-size: var(--font-size-xs);
  color: var(--accent-green);
  font-weight: 500;
}

.user-dropdown-icon {
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: transform var(--transition-fast);
}

.user-profile-btn[aria-expanded="true"] .user-dropdown-icon {
  transform: rotate(180deg);
}

/* Sidebar Controls */
.sidebar-controls {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  padding: var(--space-sm) 0;
}

.control-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1rem;
  text-decoration: none;
}

.control-btn:hover {
  background: var(--surface-highlight);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.control-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: var(--accent-red);
  color: white;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-secondary);
}

/* Guest controls (non-authenticated users) */
.sidebar-controls-guest {
  margin: var(--space-md);
  padding: var(--space-sm);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-dark);
}

/* Main Content Area */
.app-content {
  margin-right: var(--sidebar-width);
  margin-left: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

/* Top Bar */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-dark);
  padding: var(--space-md) var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

/* Top Bar Brand */
.top-bar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-primary);
  font-size: var(--font-size-xl);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.top-bar-brand:hover {
  color: var(--text-primary);
}

.top-bar-brand i {
  color: var(--accent-blue);
  font-size: 1.5rem;
}

/* Search Container */
.search-container {
  flex: 1;
  max-width: 100%;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.search-form:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.search-input {
  flex: 1;
  padding: var(--space-md) var(--space-lg) !important;
  padding-left: 88px !important;
  background: transparent !important;
  border: none !important;
  -webkit-appearance: none;
  appearance: none;
  color: var(--text-primary) !important;
  font-size: var(--font-size-sm);
  border-radius: 0 !important;
  min-width: 0;
}

.search-input::placeholder {
  color: var(--text-placeholder) !important;
}

.search-input:focus {
  outline: none !important;
  box-shadow: none !important;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: var(--space-lg);
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 1;
}

[dir="rtl"] .search-input {
  padding-left: var(--space-lg) !important;
  padding-right: 88px !important;
}

[dir="rtl"] .search-icon {
  left: auto;
  right: var(--space-lg);
}

/* Remove native search field decorations that overlap the custom icon */
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
  display: none;
}

.search-btn {
  padding: var(--space-md) var(--space-xl);
  background: var(--accent-blue);
  color: white;
  border: none;
  font-weight: 600;
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.search-btn:hover {
  background: var(--accent-blue-hover);
}

.search-advanced-btn {
  padding: var(--space-md) var(--space-xl);
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  font-size: var(--font-size-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  border-left: 1px solid var(--border-medium);
  flex-shrink: 0;
  border-top-right-radius: var(--radius-full);
  border-bottom-right-radius: var(--radius-full);
}

.search-advanced-btn:hover {
  background: var(--surface-highlight);
  color: var(--accent-blue);
}

/* Top Bar Actions (legacy - kept for compatibility) */
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
}

.icon-btn:hover {
  background: var(--surface-highlight);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.icon-btn .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  background: var(--accent-red);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-card);
}

/* User Avatar in Top Bar */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--border-medium);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.user-avatar:hover {
  border-color: var(--accent-blue);
}

.user-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
}

/* Hide old top elements */
.top-logo-bar,
.search-bar-container {
  display: none !important;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: var(--space-xl);
  max-width: var(--content-max-width);
  margin: 0 auto;
  width: 100%;
}

/* Page Title */
.page-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

/* Footer */
.app-footer {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-dark);
  background: var(--bg-secondary);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

/* Hide old navbar elements */
nav.navbar,
.search-bar-wrap,
.top-navbar,
.navbar, 
.navbar-expand-lg,
.navbar-dark,
.navbar-collapse,
.navbar-nav,
.navbar-toggler,
.navbar-brand {
  display: none !important;
}

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-dark);
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  z-index: 1001;
}

.mobile-menu-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-sm);
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
}

.mobile-logo i {
  color: var(--accent-blue);
}

.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.mobile-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 1.25rem;
  text-decoration: none;
  background: none;
  border: none;
  padding: var(--space-sm);
  cursor: pointer;
}

.mobile-avatar,
.mobile-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.mobile-avatar-placeholder {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.mobile-search-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: calc(60px + var(--space-sm)) var(--space-md) var(--space-md);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-dark);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  z-index: 1002;
}

.mobile-search-overlay.show {
  display: block;
}

.mobile-search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.mobile-search-close {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  padding: var(--space-sm);
  border-radius: var(--radius-full);
  cursor: pointer;
}

.mobile-search-close:hover {
  background: var(--surface-highlight);
}

.mobile-search-overlay .search-form {
  box-shadow: var(--shadow-sm);
}

body.no-scroll {
  overflow: hidden;
}

@media (max-width: 575.98px) {
  .mobile-search-overlay .search-form {
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding-right: var(--space-md);
  }

  .mobile-search-overlay .search-btn,
  .mobile-search-overlay .search-advanced-btn {
    width: 100%;
    border-radius: var(--radius-md);
    border-left: 1px solid var(--border-medium);
  }

  .mobile-search-overlay .search-advanced-btn {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
  }
}

@media (min-width: 992px) {
  .mobile-search-overlay {
    display: none !important;
  }
}

/* =====================================================
   Responsive Design
   ===================================================== */
@media (max-width: 991.98px) {
  .mobile-header {
    display: flex !important;
  }

  .app-sidebar {
    transform: translateX(100%);
    width: 50vw;
    max-width: 180px;
    min-width: 0;
    top: var(--topbar-height);
    height: calc(100vh - var(--topbar-height));
    z-index: 1100;
  }

  .app-sidebar.show {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .app-content {
    margin-right: 0;
    padding-top: 60px;
  }

  .main-content {
    padding: var(--space-md);
  }

  .top-bar {
    display: none;
  }

  .sidebar-nav {
    padding-bottom: 120px;
  }
}

@media (min-width: 992px) {
  .mobile-header {
    display: none !important;
  }

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

@media (max-width: 575.98px) {
  .main-content {
    padding: var(--space-sm);
  }

  /* Tighter cards on small screens for consistent sizing */
  .card {
    border-radius: 12px;
    margin-bottom: var(--space-sm);
  }

  .card > .card-body {
    padding: var(--space-md);
  }

  .card > .card-header,
  .card > .card-footer {
    padding: var(--space-sm) var(--space-md);
  }
}

/* =====================================================
   Animation Utilities
   ===================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.4s ease-out;
}

/* =====================================================
   Accessibility
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* =====================================================
   Scrollbar Styling
   ===================================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
