@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Color Palette */
  --primary: #2F6BFF;
  --primary-hover: #1e56e0;
  --primary-soft: rgba(47, 107, 255, 0.1);
  
  --secondary: #1B254B;
  --secondary-hover: #121933;
  --secondary-soft: rgba(27, 37, 75, 0.1);
  
  --bg-app: #F8F9FC;
  --bg-card: #FFFFFF;
  --border-color: #E9ECEF;
  --text-main: #212529;
  --text-soft: #6C757D;
  
  --success: #16A34A;
  --success-soft: rgba(22, 163, 74, 0.1);
  
  --danger: #DC3545;
  --danger-soft: rgba(220, 53, 69, 0.1);
  
  --warning: #F59E0B;
  --warning-soft: rgba(245, 158, 11, 0.1);
  
  --info: #0EA5E9;
  --info-soft: rgba(14, 165, 233, 0.1);

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 80px;
  --navbar-height: 70px;
  --transition-speed: 0.25s;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Shadow */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
  --primary: #4D82FF;
  --primary-hover: #6e9bff;
  --primary-soft: rgba(77, 130, 255, 0.15);
  
  --secondary: #E2E8F0;
  --secondary-hover: #FFFFFF;
  --secondary-soft: rgba(226, 232, 240, 0.15);
  
  --bg-app: #0B0F19;
  --bg-card: #111827;
  --border-color: #1F2937;
  --text-main: #F3F4F6;
  --text-soft: #9CA3AF;
  
  --success: #22C55E;
  --success-soft: rgba(34, 197, 94, 0.15);
  
  --danger: #EF4444;
  --danger-soft: rgba(239, 68, 68, 0.15);
  
  --warning: #F59E0B;
  --warning-soft: rgba(245, 158, 11, 0.15);
  
  --info: #0EA5E9;
  --info-soft: rgba(14, 165, 233, 0.15);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --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.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

/* Global Reset & Basic Layout */
body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  transition: background-color var(--transition-speed), color var(--transition-speed);
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-soft);
}

/* Base Headings & Links */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 600;
}
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-speed);
}
a:hover {
  color: var(--primary-hover);
}

/* Theme Elements Overrides */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  border-radius: 12px;
  transition: background-color var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
}

.card-footer {
  background-color: transparent;
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
}

/* Form Styles & Focus Effects */
.form-label {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.875rem;
}
.text-soft {
  color: var(--text-soft) !important;
}

.form-control, .form-select {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed), background-color var(--transition-speed), color var(--transition-speed);
}

.form-control:focus, .form-select:focus {
  background-color: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
  color: var(--text-main);
}

/* Sm Sized Inputs Override */
.form-control-sm {
  padding: 0.35rem 0.75rem !important;
  font-size: 0.825rem;
  border-radius: 6px;
}

.form-select-sm {
  padding: 0.35rem 2.25rem 0.35rem 0.75rem !important;
  font-size: 0.825rem;
  border-radius: 6px;
}

.form-control::placeholder {
  color: var(--text-soft);
  opacity: 0.7;
}

.form-check-input {
  background-color: var(--bg-card);
  border-color: var(--border-color);
}
.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}
.form-check-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

/* Button Custom Styles */
.btn {
  font-weight: 500;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  transition: all var(--transition-speed);
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background-color: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  color: #fff !important;
}
.btn-primary:focus {
  box-shadow: 0 0 0 4px var(--primary-soft) !important;
}

.btn-secondary {
  background-color: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
}
.btn-secondary:hover, .btn-secondary:focus, .btn-secondary:active {
  background-color: var(--secondary-hover) !important;
  border-color: var(--secondary-hover) !important;
  color: #fff !important;
}

/* Soft Buttons */
.btn-soft-primary {
  background-color: var(--primary-soft);
  color: var(--primary);
  border: 1px solid transparent;
}
.btn-soft-primary:hover {
  background-color: var(--primary);
  color: #fff;
}

.btn-soft-secondary {
  background-color: var(--secondary-soft);
  color: var(--secondary);
  border: 1px solid transparent;
}
.btn-soft-secondary:hover {
  background-color: var(--secondary);
  color: #fff;
}

.btn-soft-success {
  background-color: var(--success-soft);
  color: var(--success);
  border: 1px solid transparent;
}
.btn-soft-success:hover {
  background-color: var(--success);
  color: #fff;
}

.btn-soft-danger {
  background-color: var(--danger-soft);
  color: var(--danger);
  border: 1px solid transparent;
}
.btn-soft-danger:hover {
  background-color: var(--danger);
  color: #fff;
}

/* Outline custom */
.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
  background-color: transparent;
}
.btn-outline-primary:hover {
  background-color: var(--primary);
  color: #fff;
}

/* Badge custom */
.badge-soft-primary {
  background-color: var(--primary-soft);
  color: var(--primary);
}
.badge-soft-success {
  background-color: var(--success-soft);
  color: var(--success);
}
.badge-soft-danger {
  background-color: var(--danger-soft);
  color: var(--danger);
}
.badge-soft-warning {
  background-color: var(--warning-soft);
  color: var(--warning);
}

/* Admin Dashboard layout wrapper */
.app-wrapper {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Sidebar navigation */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1030;
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-color);
  transition: width var(--transition-speed) ease, transform var(--transition-speed) ease;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
  transition: all var(--transition-speed);
}

.sidebar-brand i {
  font-size: 1.5rem;
  margin-right: 0.75rem;
}

.sidebar-menu {
  list-style: none;
  padding: 1.5rem 0.75rem;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-item {
  margin-bottom: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.925rem;
  transition: all var(--transition-speed);
  position: relative;
  text-decoration: none;
}

.sidebar-link i {
  font-size: 1.2rem;
  margin-right: 0.85rem;
  width: 1.5rem;
  text-align: center;
  transition: all var(--transition-speed);
}

.sidebar-link:hover, .sidebar-link.active {
  color: var(--primary);
  background-color: var(--primary-soft);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 4px;
  background-color: var(--primary);
  border-radius: 0 4px 4px 0;
}

.sidebar-heading {
  padding: 1rem 1rem 0.5rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  opacity: 0.7;
}

/* Main Content wrapper */
.main-wrapper {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-speed) ease, width var(--transition-speed) ease;
}

/* Navbar styles */
.navbar-custom {
  height: var(--navbar-height);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1020;
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.navbar-toggle {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-soft);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

.navbar-toggle:hover {
  background-color: var(--primary-soft);
  color: var(--primary);
}

/* Breadcrumb styles */
.breadcrumb-item + .breadcrumb-item::before {
  content: var(--bs-breadcrumb-divider, "/");
  color: var(--text-soft);
}

.breadcrumb-item a {
  color: var(--text-soft);
}
.breadcrumb-item.active {
  color: var(--text-main);
  font-weight: 500;
}

/* Footer styles */
.footer-custom {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  margin-top: auto;
  font-size: 0.875rem;
  color: var(--text-soft);
}

/* Collapsed Sidebar behavior */
body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-brand span {
  display: none;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .sidebar-brand i {
  margin: 0;
  font-size: 1.75rem;
}

body.sidebar-collapsed .sidebar-link span {
  display: none;
}

body.sidebar-collapsed .sidebar-link i {
  margin-right: 0;
  font-size: 1.4rem;
  width: 100%;
}

body.sidebar-collapsed .sidebar-heading {
  display: none;
}

body.sidebar-collapsed .main-wrapper {
  margin-left: var(--sidebar-collapsed-width);
  width: calc(100% - var(--sidebar-collapsed-width));
}

/* Dropdowns style */
.dropdown-menu {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  border-radius: 8px;
  padding: 0.5rem;
}

.dropdown-item {
  color: var(--text-main);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  transition: all var(--transition-speed);
}

.dropdown-item:hover, .dropdown-item:focus {
  background-color: var(--primary-soft);
  color: var(--primary);
}

.dropdown-divider {
  border-color: var(--border-color);
}

/* Custom Table Style (Bootstrap Table override) */
.table {
  color: var(--text-main);
  border-color: var(--border-color);
}

.table th {
  font-weight: 600;
  color: var(--text-main);
  border-bottom: 2px solid var(--border-color);
  background-color: var(--bg-card);
}

.table td {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-card);
}

.table-hover tbody tr:hover td {
  background-color: var(--primary-soft);
  color: var(--text-main);
}

/* Responsive sidebar drawer for mobile view */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  body.sidebar-open .sidebar {
    transform: translateX(0);
    width: var(--sidebar-width);
  }
  
  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }

  body.sidebar-collapsed .main-wrapper {
    margin-left: 0;
    width: 100%;
  }
}

/* Collapsible submenu styles */
.sidebar-submenu {
  list-style: none;
  padding-left: 2.25rem;
  margin: 0.25rem 0 0.5rem 0;
  display: none;
}

.sidebar-submenu.show {
  display: block;
}

.sidebar-submenu-link {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text-soft);
  border-radius: 6px;
  transition: all var(--transition-speed);
}

.sidebar-submenu-link:hover, .sidebar-submenu-link.active {
  color: var(--primary);
  background-color: var(--primary-soft);
}

/* Sidebar submenu toggle rotation */
.sidebar-link[data-bs-toggle="collapse"]::after {
  content: '\F282'; /* bootstrap icon chevron-down */
  font-family: 'bootstrap-icons';
  margin-left: auto;
  font-size: 0.8rem;
  transition: transform var(--transition-speed);
}

.sidebar-link[data-bs-toggle="collapse"]:not(.collapsed)::after {
  transform: rotate(180deg);
}

/* Landing Page Specific Custom Styles */
.landing-hero {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-app) 100%);
  padding: 8rem 0 6rem 0;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.landing-navbar {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-speed);
}

[data-theme="dark"] .landing-navbar {
  background-color: rgba(17, 24, 39, 0.8);
}

.feature-card {
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  border-radius: 12px;
  padding: 2.5rem;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Dynamic Avatar Initials Styles */
.avatar-initials {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  text-transform: uppercase;
  user-select: none;
}

.avatar-initials-md {
  width: 48px;
  height: 48px;
  font-size: 1.125rem;
}

.avatar-initials-lg {
  width: 72px;
  height: 72px;
  font-size: 1.5rem;
}

.avatar-initials-xl {
  width: 130px;
  height: 130px;
  font-size: 2.75rem;
}
