:root {
  /* Enhanced color palette with brighter options */
  --bg-light: #f9f9f9;
  --bg-dark: #1e1e2f;
  --text-light: #222;
  --text-dark: #ffffff;
  --sidebar-width: 250px;
  --sidebar-collapsed: 60px;
  
  /* Brighter accent colors */
  --accent: #007acc;
  --accent-hover: #0099ff;
  --accent-gradient: linear-gradient(135deg, #007acc, #00c3ff);
  --accent-soft: rgba(0, 122, 204, 0.15);
  
  /* Vibrant secondary colors */ 
  --success: #2ecc71;
  --warning: #f39c12;
  --error: #e74c3c;
  --info: #3498db;
  
  /* Enhanced UI colors */
  --border: #ddd;
  --border-dark: #454545;
  --card-bg-light: #fff;
  --card-bg-dark: #2d2d2d;
  --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --btn-bg: #0e639c;
  --btn-hover: #1177bb;
  --teacher-yellow: #f9c74f;
  --main-bg-dark: linear-gradient(145deg, #0a1221, #1a2233);
  --footer-bg-dark: #0a1221;
  --footer-text-dark: #ffffff;
  --footer-logo-yellow: #f9c74f;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-dark: 0 4px 6px rgba(0, 0, 0, 0.3);
  --transition-speed: 0.3s;
  
  /* Gradients for cards and UI elements */
  --gradient-blue: linear-gradient(135deg, #0072ff, #00c6ff);
  --gradient-green: linear-gradient(135deg, #11998e, #38ef7d);
  --gradient-orange: linear-gradient(135deg, #f46b45, #eea849);
  --gradient-purple: linear-gradient(135deg, #654ea3, #eaafc8);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* Use system fonts instead of Google fonts */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* Light/Dark Theme Settings */
html[data-theme="light"] {
  background: var(--bg-light);
  color: var(--text-light);
}

html[data-theme="dark"] {
  background: var(--bg-dark);
  color: var(--text-dark);
}

html[data-theme="dark"] .bg-white {
  background: linear-gradient(145deg, #0a1221, #1a2233) !important;
  color: #eee;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  --bs-bg-opacity: 1;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Animation keyframes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes spinNeon {
  0% {
    transform: rotate(0deg);
    filter: hue-rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
    filter: hue-rotate(360deg);
  }
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dashboard Header */
.dashboard-header {
  height: 56px;
  z-index: 1060;
  background-color: var(--card-bg-light);
  transition: background-color var(--transition-speed);
}

html[data-theme="dark"] .dashboard-header {
  background-color: var(--card-bg-dark) !important;
  border-color: var(--border-dark) !important;
}

/* Dashboard Layout */
.dashboard-container {
  display: flex;
  min-height: calc(100vh - 116px); /* Account for header and footer */
}

/* Sidebar */
.sidebar {
  position: relative;
  width: var(--sidebar-width);
  background: var(--bg-light);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  transform: translateX(0);
  transition: transform var(--transition-speed), width var(--transition-speed);
  z-index: 1000;
  height: calc(100vh - 116px) !important;
}

html[data-theme="dark"] .sidebar {
  background: var(--bg-dark);
  border-color: var(--border-dark);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar .list-group-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: inherit;
  transition: background 0.2s;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.sidebar .list-group-item:hover,
.sidebar .list-group-item.active {
  background: rgba(0, 0, 0, 0.05);
}

html[data-theme="dark"] .sidebar .list-group-item:hover,
html[data-theme="dark"] .sidebar .list-group-item.active {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar .list-group-item.active {
  border-left: 3px solid var(--accent);
}

.sidebar.collapsed .label-text {
  display: none;
}

/* Toggle button in sidebar */
#collapseSidebar {
  border-top: 1px solid var(--border);
  margin-top: auto;
  text-align: center;
  cursor: pointer;
}

html[data-theme="dark"] #collapseSidebar {
  border-color: var(--border-dark);
}

.sidebar.collapsed #collapseSidebar i {
  transform: rotate(180deg);
  transition: transform 0.3s;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background-color: var(--bg-light);
  transition: all var(--transition-speed);
  height: calc(100vh - 116px);
}

html[data-theme="dark"] .main-content {
  background-color: var(--bg-dark);
}

/* Tab Panes */
.tab-pane {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.tab-pane.active {
  display: block;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .page-header {
  border-color: var(--border-dark);
}

.page-title {
  font-size: 1.8rem;
  font-weight: 300;
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* Improved form layout and responsive "Open in New Tab" button */
.header-actions .open-tab-btn {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.dashboard-grid .card {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dashboard-grid .card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

html[data-theme="dark"] .dashboard-grid .card:hover {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

/* Cards */
.card {
  background-color: var(--card-bg-light);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease-out;
  border: none;
}

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

html[data-theme="dark"] .card {
  background-color: var(--card-bg-dark);
  border-color: var(--border-dark);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .card:hover {
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.6);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.02);
  flex-wrap: wrap;
}

html[data-theme="dark"] .card-header {
  border-color: var(--border-dark);
  background-color: rgba(255, 255, 255, 0.03);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.card-icon {
  color: var(--accent);
  font-size: 1.1em;
}

.card-body {
  padding: 22px;
}

.card-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.01);
}

html[data-theme="dark"] .card-footer {
  border-color: var(--border-dark);
  background-color: rgba(255, 255, 255, 0.02);
}

/* Statistics */
.stat-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  color: var(--text-light);
}

html[data-theme="dark"] .stat-label {
  color: var(--text-dark);
  opacity: 0.8;
}

.stat-value {
  font-weight: bold;
  font-size: 1.1rem;
}

.progress-container {
  margin-top: 10px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  height: 10px;
  overflow: hidden;
}

html[data-theme="dark"] .progress-container {
  background-color: rgba(255, 255, 255, 0.1);
}

.progress-bar {
  height: 100%;
  background: var(--gradient-blue);
  border-radius: 10px;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Recent Activity */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.activity-item {
  display: flex;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  transition: transform 0.2s ease;
}

.activity-item:hover {
  transform: translateX(5px);
}

html[data-theme="dark"] .activity-item {
  border-color: var(--border-dark);
}

.activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.activity-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.activity-item:hover .activity-icon {
  transform: scale(1.1);
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 1.05rem;
}

.activity-time {
  color: var(--text-light);
  opacity: 0.7;
  font-size: 0.85rem;
}

html[data-theme="dark"] .activity-time {
  color: var(--text-dark);
  opacity: 0.7;
}

/* Course Cards */
.course-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.course-image {
  height: 160px;
  background: var(--gradient-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2.8rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.course-image:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.card:hover .course-image:before {
  transform: translateX(100%);
}

.course-progress {
  margin: 18px 0;
}

.course-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.course-level {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  background-color: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: 8px;
  background-color: var(--btn-bg);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.95rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  background-color: var(--btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn-outline {
  background-color: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.btn-success {
  background-color: var(--success);
}

.btn-success:hover {
  background-color: #27ae60;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
}

/* Badge */
.badge {
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: bold;
}

.badge-success {
  background-color: rgba(46, 204, 113, 0.2);
  color: var(--success);
}

.badge-warning {
  background-color: rgba(243, 156, 18, 0.2);
  color: var(--warning);
}

.badge-danger {
  background-color: rgba(231, 76, 60, 0.2);
  color: var(--error);
}

/* Forms */
.form-control, .form-select {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-light);
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
  color: var(--text-dark);
  background-color: #3a3a3a;
  border-color: var(--border-dark);
}

.form-control:focus, .form-select:focus {
  color: var(--text-light);
  background-color: #fff;
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(0, 122, 204, 0.25);
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
  color: var(--text-dark);
  background-color: #3a3a3a;
  border-color: var(--accent);
}

.form-label {
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* Password required styling */
.password-required {
  border: 1px solid var(--error) !important;
  box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.25) !important;
  animation: pulse 1s;
}

.password-required::before {
  content: "Bắt buộc nhập mật khẩu để xác nhận thay đổi";
  display: block;
  color: var(--error);
  font-size: 0.85rem;
  margin-bottom: 5px;
  font-weight: 500;
}

.is-invalid {
  border-color: var(--error) !important;
}

/* Enhanced password input area */
#currentPasswordInput {
  position: relative;
  opacity: 1 !important;
  max-height: 100px !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
  transition: all 0.3s ease;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 15px 0;
  background-color: rgba(0, 0, 0, 0.02);
}

html[data-theme="dark"] #currentPasswordInput {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border-dark);
}

/* Disabled form field styling */
.form-select:disabled,
.form-control:disabled {
  background-color: rgba(0, 0, 0, 0.05);
  opacity: 0.8;
  cursor: not-allowed;
}

html[data-theme="dark"] .form-select:disabled,
html[data-theme="dark"] .form-control:disabled {
  background-color: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
}

/* Avatar */
.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 1rem;
}

/* Avatar fallback for missing images */
.avatar-container {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
}

.user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-fallback {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 24px;
}

/* Fallback logo */
.fallback-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
}

/* Teacher badge */
.teacher-badge {
  background: linear-gradient(to right, #f9c74f, #f8961e);
  color: #222;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(249, 199, 79, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(249, 199, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(249, 199, 79, 0); }
}

.teacher-badge::before {
  content: "✓";
  font-weight: bold;
}

/* Table */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th, td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] th,
html[data-theme="dark"] td {
  border-color: var(--border-dark);
}

th {
  background-color: rgba(0, 0, 0, 0.05);
  font-weight: 500;
}

html[data-theme="dark"] th {
  background-color: rgba(0, 0, 0, 0.2);
}

tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

html[data-theme="dark"] tr:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Footer */
.site-footer {
  height: 60px;
  line-height: 60px;
  text-align: center;
  background: rgba(0, 0, 0, 0.05);
  border-top: 1px solid var(--border);
  font-size: 1rem;
}

html[data-theme="dark"] .site-footer {
  background: linear-gradient(90deg, #004a77, #006da8);
  border-color: var(--border-dark);
  color: var(--footer-text-dark);
}

.footer-brand {
  display: inline-block;
  font-weight: 600;
  margin-right: 0.5rem;
}

.footer-logo {
  color: var(--footer-logo-yellow);
  font-weight: 700;
}

/* Logo */
.logo-link {
  text-decoration: none;
  color: var(--text-light);
  display: flex;
  align-items: center;
}

html[data-theme="dark"] .logo-link {
  color: var(--text-dark);
}

.logo-wrapper {
  position: relative;
  display: inline-block;
  border-radius: 50%;
  padding: 4px;
}

.logo-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #00c6ff, #ff9a00, #00c6ff);
  animation: spinNeon 4s linear infinite;
  z-index: -1;
  filter: blur(3px) brightness(1.4);
}

.logo-wrapper img.logo-img {
  display: block;
  border-radius: 50%;
  height: 40px;
  width: 40px;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.logo-title {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(to right, #007ACC, #00B4FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  margin-left: 18px;
  white-space: nowrap;
}

html[data-theme="dark"] .logo-title {
  background: linear-gradient(to right, #ff9a00, #f9c74f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  text-align: center;
}

/* Helper classes */
.d-none {
  display: none !important;
}

.text-muted {
  color: var(--text-light);
  opacity: 0.7;
}

html[data-theme="dark"] .text-muted {
  color: var(--text-dark);
  opacity: 0.7;
}

.text-center {
  text-align: center;
}

.d-flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.align-items-center {
  align-items: center;
}

.justify-content-between {
  justify-content: space-between;
}

.justify-content-center {
  justify-content: center;
}

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.me-3 { margin-right: 1rem; }
.me-4 { margin-right: 1.5rem; }
.me-5 { margin-right: 3rem; }

.ms-1 { margin-left: 0.25rem; }
.ms-2 { margin-left: 0.5rem; }
.ms-3 { margin-left: 1rem; }
.ms-4 { margin-left: 1.5rem; }
.ms-5 { margin-left: 3rem; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.px-4 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-5 { padding-left: 3rem; padding-right: 3rem; }

.border-bottom {
  border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .border-bottom {
  border-color: var(--border-dark);
}

/* Mobile Menu Button */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: var(--gradient-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  font-size: 1.6rem;
  box-shadow: var(--shadow);
  z-index: 1000;
  cursor: pointer;
  transition: transform 0.3s;
}

.mobile-menu-toggle:hover {
  transform: scale(1.1);
}

/* Welcome Banner */
.welcome-banner {
  background: var(--gradient-blue);
  border-radius: 16px;
  margin-bottom: 30px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  position: relative;
  display: block !important;
  animation: slideInDown 0.8s ease-out;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] .welcome-banner {
  background: linear-gradient(135deg, #204065, #122e49);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.welcome-content {
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
}

.welcome-avatar {
  position: relative;
  flex-shrink: 0;
}

.welcome-avatar img,
.welcome-avatar .avatar-fallback {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.welcome-avatar img:hover,
.welcome-avatar .avatar-fallback:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.welcome-avatar .avatar-fallback {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 32px;
}

.welcome-text {
  color: white;
  flex: 1;
}

.welcome-text h2 {
  font-size: 2.2rem;
  margin-bottom: 4px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.welcome-role {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.welcome-tools-text {
  margin-top: 16px;
  margin-bottom: 10px;
  font-weight: 500;
}

.welcome-tools-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-teacher {
  background-color: rgba(255, 255, 255, 0.25);
  border: none;
  color: white;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.btn-teacher:hover {
  background-color: rgba(255, 255, 255, 0.4);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.welcome-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.welcome-close:hover {
  background-color: rgba(255, 255, 255, 0.4);
  transform: rotate(90deg);
}

/* Responsive Styles */
@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    height: calc(100% - 56px);
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

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

  .dashboard-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }

  .page-title {
    font-size: 1.6rem;
  }

  .mobile-menu-toggle {
    display: flex;
  }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .card {
    margin-bottom: 0;
  }

  .welcome-content {
    flex-direction: column;
    text-align: center;
    padding: 20px 15px 30px;
  }

  .welcome-text {
    width: 100%;
  }

  .welcome-text h2 {
    font-size: 1.8rem;
  }

  .welcome-tools-buttons {
    justify-content: center;
  }

  .welcome-close {
    top: 10px;
    right: 10px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .header-actions {
    width: 100%;
    margin-top: 10px;
  }

  .header-actions .btn {
    width: auto;
  }

  .header-actions .open-tab-btn .btn-text {
    display: none;
  }

  .header-actions .open-tab-btn {
    padding: 6px 10px;
    max-width: none;
  }

  .form-container {
    overflow-x: auto;
    max-width: 100%;
  }

  .form-container iframe,
  .form-container form,
  .form-container input,
  .form-container select,
  .form-container textarea {
    max-width: 100%;
  }

  .form-container iframe {
    max-width: 100%;
    overflow-x: auto;
  }

  .logo-img {
    width: 36px !important;
    height: 36px !important;
    object-fit: contain !important;
  }

  .logo-wrapper {
    margin-right: 10px !important;
  }

  .main-content {
    padding: 1rem;
  }

  .table,
  .table thead,
  .table tbody,
  .table th,
  .table td,
  .table tr {
    display: block;
    width: 100%;
  }

  .table thead {
    display: none;
  }

  .table tbody tr {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    background-color: var(--card-bg-light);
    overflow: hidden;
  }
  
  html[data-theme="dark"] .table tbody tr {
    background-color: var(--card-bg-dark);
    border-color: var(--border-dark);
  }

  .table tr:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
  }

  .table td {
    padding: 12px 15px;
    position: relative;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
    text-align: right;
  }
  
  html[data-theme="dark"] .table td {
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  
  .table td:last-child {
    border-bottom: none;
  }

  .table td::before {
    content: attr(data-label);
    font-weight: 600;
    width: 40%;
    color: var(--accent);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
  }
  
  .table td > * {
    width: 60%;
    text-align: right;
  }
  
  .table-responsive {
    border: none;
    box-shadow: none;
    margin-bottom: 2rem;
  }
}

@media (max-width: 576px) {
  .logo-title {
    font-size: 18px;
  }

  .welcome-text h2 {
    font-size: 1.6rem;
  }

  .welcome-role {
    font-size: 1rem;
  }

  .btn {
    padding: 8px 14px;
  }

  .btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .page-title {
    font-size: 1.4rem;
  }
}

/* Bootstrap-compatible classes */
.container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
  background: aliceblue;
}
div#userGreeting {
  display: none;
}
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col-md-4, .col-md-8 {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
}

@media (min-width: 768px) {
  .col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
  .col-md-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
  }
}

.bg-success {
  background-color: var(--success) !important;
}

.bg-warning {
  background-color: var(--warning) !important;
}

.bg-danger {
  background-color: var(--error) !important;
}

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

.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.btn-outline-secondary {
  color: var(--text-light);
  border-color: var(--border);
  background-color: transparent;
}

html[data-theme="dark"] .btn-outline-secondary {
  color: var(--text-dark);
  border-color: var(--border-dark);
}

.btn-outline-secondary:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

html[data-theme="dark"] .btn-outline-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-outline-danger {
  color: var(--error);
  border-color: var(--error);
  background-color: transparent;
}

.btn-outline-danger:hover {
  background-color: rgba(244, 71, 71, 0.1);
}

/* Colorful course cards */
.course-card:nth-child(3n+1) .course-image {
  background: var(--gradient-blue);
}

.course-card:nth-child(3n+2) .course-image {
  background: var(--gradient-green);
}

.course-card:nth-child(3n+3) .course-image {
  background: var(--gradient-purple);
}
#sidebar.collapsed .nav-text {
  display: none;
}
#sidebar.collapsed .nav-item i {
  display: block;
  text-align: center;
  font-size: 1.25rem;
}
.nav-text {
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
#sidebar.collapsed .nav-text {
  opacity: 0;
  visibility: hidden;
  width: 0;
}

/* Teacher Tabs Styling */
.nav-item-separator {
  padding: 10px 15px 5px;
  position: relative;
  margin-top: 10px;
}

.separator-line {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 5px 0;
}

html[data-theme="dark"] .separator-line {
  border-color: var(--border-dark);
}

.separator-text {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 5px;
}

.teacher-tab {
  background-color: var(--accent-soft) !important;
  transition: all 0.2s ease !important;
}

.teacher-tab:hover {
  background-color: rgba(0, 122, 204, 0.25) !important;
}

html[data-theme="dark"] .teacher-tab {
  background-color: rgba(0, 122, 204, 0.15) !important;
}

html[data-theme="dark"] .teacher-tab:hover {
  background-color: rgba(0, 122, 204, 0.3) !important;
}

.teacher-tab.active {
  background-color: var(--accent) !important;
  color: white !important;
}

.teacher-tab i {
  color: var(--accent);
}

.teacher-tab.active i {
  color: white;
}

.form-container {
  min-height: 400px;
}

/* Spinner for loading states */
.spinner-border {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: text-bottom;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border .75s linear infinite;
}

@keyframes spinner-border {
  to { transform: rotate(360deg); }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Adjust the sidebar collapsed state for teacher tabs */
#sidebar.collapsed .separator-text {
  display: none;
}

#sidebar.collapsed .teacher-tab i {
  margin-right: 0;
}

/* Exam List Enhancements */
.exam-filters {
  background-color: rgba(0, 122, 204, 0.05);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

html[data-theme="dark"] .exam-filters {
  background-color: rgba(0, 122, 204, 0.1);
  border-color: var(--border-dark);
}

.dropdown-menu {
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  animation: fadeIn 0.2s ease-out;
}

html[data-theme="dark"] .dropdown-menu {
  background-color: var(--card-bg-dark);
  border-color: var(--border-dark);
}

.dropdown-item {
  padding: 8px 16px;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: rgba(0, 122, 204, 0.1);
}

html[data-theme="dark"] .dropdown-item {
  color: var(--text-dark);
}

html[data-theme="dark"] .dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-item i {
  width: 20px;
  text-align: center;
  margin-right: 8px;
  color: var(--accent);
}

/* Enhanced File Input Styling */
.file-upload-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.avatar-preview-container {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.avatar-preview-container:hover {
  transform: scale(1.05);
}

.avatar-preview-container::after {
  content: "\f030"; /* Camera icon */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--accent);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.avatar-preview-container:hover::after {
  opacity: 1;
}

.avatar-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  background-color: var(--accent-soft);
  color: var(--accent);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.avatar-upload-btn:hover {
  background-color: rgba(0, 122, 204, 0.25);
}

.avatar-upload-btn i {
  font-size: 16px;
}

/* Teacher Tab Button Styles */
.btn-group {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
}

.btn-group .btn {
  border-radius: 0;
  margin: 0;
}

.btn-group .btn:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.btn-group .btn:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

/* Better progress visualization */
#progressChartContainer {
  height: 250px;
  margin: 20px 0;
  position: relative;
}

#progressChart {
  width: 100%;
  height: 100%;
}

/* Fix for buttons to open tabs */
[data-tab] {
  cursor: pointer;
}

/* Subscription Plan Cards */
.subscription-plans {
  margin-top: 2rem;
}

.plan-card {
  background-color: var(--card-bg-light);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}

html[data-theme="dark"] .plan-card {
  background-color: var(--card-bg-dark);
  border-color: var(--border-dark);
}

.plan-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--card-shadow-hover);
}

.plan-card.popular {
  border: 2px solid var(--accent);
  transform: scale(1.05);
}

.plan-card.popular:hover {
  transform: translateY(-10px) scale(1.05);
}

.popular-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent);
  color: white;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom-left-radius: 8px;
}

.plan-header {
  padding: 25px 20px 15px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .plan-header {
  border-color: var(--border-dark);
}

.plan-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--accent);
}

.plan-price {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.price {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.period {
  font-size: 0.9rem;
  opacity: 0.7;
}

.plan-body {
  padding: 20px;
  flex-grow: 1;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plan-features li {
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  line-height: 1.4;
}

.plan-features i {
  color: var(--success);
  margin-right: 10px;
  margin-top: 3px;
}

.plan-footer {
  padding: 20px;
  text-align: center;
  border-top: 1px solid var(--border);
}

html[data-theme="dark"] .plan-footer {
  border-color: var(--border-dark);
}

.btn-subscribe {
  background: var(--gradient-blue);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 80%;
}

.btn-subscribe:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] .btn-subscribe:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Current Subscription Status */
.subscription-status {
  background: linear-gradient(135deg, #f6f8fc, #eef1f5);
  border-left: 4px solid var(--accent);
}

html[data-theme="dark"] .subscription-status {
  background: linear-gradient(135deg, #2a3041, #1e2430);
}

#currentSubscription {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.sub-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.sub-tier {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 5px;
}

.sub-details {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 10px;
}

.sub-detail-item {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.05);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
}

html[data-theme="dark"] .sub-detail-item {
  background: rgba(255, 255, 255, 0.1);
}

.sub-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

/* Responsive adjustments for subscription cards */
@media (max-width: 768px) {
  .plan-card.popular {
    transform: none;
  }
  
  .plan-card.popular:hover {
    transform: translateY(-10px);
  }
  
  .sub-actions {
    margin-left: 0;
    margin-top: 15px;
    width: 100%;
  }
  
  .sub-actions .btn {
    flex: 1;
  }
}