/* Modern Design System */
:root {
  /* Color Palette */
  --bg-color: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-color: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  /* Interactive Colors */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #e0e7ff;
  --primary-dark: #0c183d;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Neutral Colors */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Surface Colors */
  --surface-glass: rgba(255, 255, 255, 0.8);
  --surface-elevated: #ffffff;
  --surface-overlay: rgba(0, 0, 0, 0.05);

  /* Interactive Elements */
  --btn-outline-color: var(--gray-300);
  --btn-background-color: var(--gray-100);
  --btn-hover-transform: translateY(-1px);

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

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* 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);
  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.37);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;
}

/* Dark Theme Variables - Navy Based */
[data-bs-theme="dark"] {
  --bg-color: #040712;

  --bg-secondary: #0a0e1a;
  --bg-tertiary: #141829;
  --bs-body-bg: #040712;
  --text-color: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Dark navy surface colors */
  --surface-glass: rgba(4, 7, 18, 0.85);
  --surface-elevated: #0a0e1a;
  --surface-overlay: rgba(255, 255, 255, 0.08);

  --btn-outline-color: #334155;
  --btn-background-color: #1e293b;

  /* Adjust shadows for dark navy mode */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
}

/* Body Styles */
body {
  height: 100vh;
  margin: 0;
  overflow: hidden;
  transition:
    background-color var(--transition-slow),
    color var(--transition-slow);
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-feature-settings:
    "kern" 1,
    "liga" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.btn {
  border-radius: var(--radius-full);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), var(--success));
  border: 2px solid var(--success);
}

main {
  height: inherit;
}

/* Enhanced form controls */
.form-control {
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  transition: all var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

[data-bs-theme="dark"] .form-control {
  border-color: #334155;
  background-color: var(--bg-secondary);
  color: var(--text-color);
}

[data-bs-theme="dark"] .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Modern Sidebar with Glass Effect */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 250px;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--surface-overlay);
  color: var(--text-color);
  transform: translateX(0);
  transition: transform var(--transition-slow);
  /* overflow-y: auto; */
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  z-index: 1000;
}

#sidebar.collapsed {
  transform: translateX(-250px);
  box-shadow: none;
}

/* Dark navy sidebar adjustments */
[data-bs-theme="dark"] #sidebar {
  border-right: 1px solid #1e293b;
}

/* Modern Sidebar Navigation */
#sidebar a {
  color: var(--text-color);
  text-decoration: none;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xs);
  transition: all var(--transition-fast);
  font-weight: 500;
}

#sidebar .nav-link.active {
  background-color: var(--primary);
  color: white;
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

#sidebar .nav-link:not(.active):hover {
  background-color: var(--surface-overlay);
  transform: translateX(2px);
}

/* Dark navy nav adjustments */
[data-bs-theme="dark"] #sidebar a {
  color: var(--text-color);
}

[data-bs-theme="dark"] #sidebar .nav-link:not(.active):hover {
  background-color: #1e293b;
}

/* Modern Sidebar Collapse Button */
#sidebarCollapse {
  z-index: 1050;
}

#sidebarCollapse.shift {
  transform: translateX(-250px);
}

#sidebarCollapse:hover {
  transform: translateX(0) scale(1.05);
  box-shadow: var(--shadow-lg);
}

#sidebarCollapse.shift:hover {
  transform: translateX(-250px) scale(1.05);
}

/* Modern Content Area */
#content {
  margin-left: 250px;
  transition: margin-left var(--transition-slow);
  flex-grow: 1;
  position: relative;
  background-color: var(--bg-color);
}

#content.shift {
  margin-left: 0;
}

iframe {
  color-scheme: light;
}

/* Modern Interactive Buttons */
#sidebarCollapse,
#themeToggle,
#returnHome {
  position: revert;
  border: none;
  padding: var(--space-sm) var(--space-md);
  transition: all var(--transition-fast);
  border-radius: var(--radius-md);
  background-color: var(--surface-elevated);
  box-shadow: var(--shadow-sm);
}

#themeToggle:hover,
#sidebarCollapse:hover,
#returnHome:hover {
  background-color: var(--btn-background-color);
  transform: var(--btn-hover-transform);
  box-shadow: var(--shadow-md);
}

#themeToggle:active,
#sidebarCollapse:active,
#returnHome:active {
  transform: scale(0.95);
}

/* Language Styles */
.language-flag {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.language-switch > a > img {
  margin-top: -5px;
}

.language-switch {
  align-self: center;
}

.language-switch:hover {
  background-color: var(--surface-overlay);
  border-radius: var(--radius-sm);
}

#sidebar .dropdown-menu {
  background-color: var(--bg-secondary);
  color: var(--text-color);
}

/* Manage Self List Item */
li.manage-self {
  padding: 8px;
  display: flex;
  align-items: center;
}

button.manage-self:hover,
.log-out:hover {
  color: #f44040;
}

/* Dropdown Menu Styles */
.dropdown-menu {
  max-height: 200px;
  overflow-y: auto;
}

.navbar-nav .dropdown-menu {
  position: absolute;
}

.dropdown-pfp {
  margin-right: 5px;
  max-width: 25px;
  border-color: #6c757d;
  border-style: solid;
  border-width: 2px;
}

/* Full Height for HTML, Body, and Content */
html,
body,
#content {
  height: 100%;
}

.modal-content {
  border-radius: var(--radius-2xl);
}

.h-90 {
  height: 90%;
}

/* Simplebar Custom Styles */
.simplebar-scrollbar:before {
  background: hsl(0, 0%, 60%);
  border-radius: 100vw;
}

.simplebar-scrollbar.simplebar-hover:before {
  background: hsl(0, 0%, 50%);
}

.simplebar-track.simplebar-vertical {
  width: 0.5em;
}

/* Custom Scrollbar Styles */
@supports (scrollbar-color: auto) {
  * {
    scrollbar-color: hsl(0, 0%, 60%) var(--bg-color);
    scrollbar-width: thin;
  }
}

::-webkit-scrollbar {
  width: 0.5em;
}

::-webkit-scrollbar-thumb {
  background: hsl(0, 0%, 60%);
  border: 0.1em solid var(--bg-color);
  border-radius: 100vw;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(0, 0%, 50%);
}
