/* ==================================================
   site.css - رياضياتي Educational Platform Styles
   Arabic RTL Educational Theme
   ================================================== */

/* ==================== CSS Variables ==================== */
:root {
  /* Primary Colors - Educational Blue Theme */
  --primary-color: #4F46E5;
  --primary-dark: #3730A3;
  --primary-light: #818CF8;

  /* Secondary Colors - Warm Accent */
  --secondary-color: #f59e0b;
  --secondary-dark: #d97706;
  --secondary-light: #fbbf24;

  /* Neutral Colors */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;

  /* Accent Colors for Features */
  --success-color: #10b981;
  --info-color: #06b6d4;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #4F46E5 0%, #3730A3 100%);
  /* Updated to match screenshot: Cyan to Blue */
  --gradient-hero: linear-gradient(135deg, #0dcaf0 0%, #0d6efd 100%);
  --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 100%);

  /* Shadows */
  --shadow-sm: 0 1px 2px 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);

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
}

/* ==================== Base Styles ==================== */
html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: auto;
  /* Changed from hidden to allow horizontal scrolling on mobile */
  min-width: 1200px;
  /* Force minimum desktop width */
}

/* ==================== Typography ==================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1rem;
}

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

/* ==================== Navigation ==================== */
.navbar {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  padding: 0.75rem 0;
  transition: all var(--transition-normal);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.navbar-logo:hover {
  transform: scale(1.05);
}

.logo-img {
  height: 60px !important;
  width: 60px !important;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
  margin-left: 12px;
  animation: logoPulse 2.5s infinite ease-in-out;
  object-fit: cover;
}

@keyframes logoPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

.navbar-brand i {
  color: var(--primary-color);
  -webkit-text-fill-color: var(--primary-color);
}

.navbar-nav .nav-link {
  color: var(--text-primary) !important;
  font-weight: 600;
  padding: 0.5rem 1rem !important;
  margin: 0 0.25rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.navbar-nav .nav-link:hover {
  color: var(--primary-color) !important;
  background-color: var(--bg-tertiary);
}

.navbar-nav .nav-link.active {
  color: var(--primary-color) !important;
  background-color: rgba(37, 99, 235, 0.1);
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: all var(--transition-fast);
  transform: translateX(50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
  width: 80%;
}

/* ==================== Hero Section ==================== */
.hero-section {
  background: var(--gradient-hero);
  min-height: 600px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 4rem 0;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-image {
  position: relative;
  z-index: 1;
}

.hero-image img {
  max-width: 100%;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
}

/* Floating Math Symbols Animation */
.math-symbol {
  position: absolute;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.15);
  animation: float 6s ease-in-out infinite;
}

.math-symbol:nth-child(1) {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.math-symbol:nth-child(2) {
  top: 60%;
  left: 5%;
  animation-delay: 1s;
}

.math-symbol:nth-child(3) {
  top: 30%;
  right: 15%;
  animation-delay: 2s;
}

.math-symbol:nth-child(4) {
  top: 70%;
  right: 10%;
  animation-delay: 3s;
}

.math-symbol:nth-child(5) {
  top: 10%;
  right: 30%;
  animation-delay: 4s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-20px) rotate(10deg);
  }
}

/* ==================== Buttons ==================== */
.btn {
  font-weight: 700;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
  z-index: 1;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #3730A3 0%, #4F46E5 100%);
  z-index: -1;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-secondary {
  background: var(--secondary-color);
  color: #ffffff;
}

.btn-secondary:hover {
  background: var(--secondary-dark);
  transform: translateY(-2px);
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
  box-shadow: none;
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
  transform: translateY(-3px);
}

.btn-outline-light {
  border: 2px solid #ffffff;
  color: #ffffff;
  background: transparent;
}

.btn-outline-light:hover {
  background: #ffffff;
  color: var(--primary-color);
}

.btn-light {
  background: #ffffff;
  color: var(--primary-color);
}

.btn-light:hover {
  background: var(--bg-tertiary);
  color: var(--primary-dark);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* ==================== Feature Cards ==================== */
.features-section {
  padding: 5rem 0;
  background: var(--bg-primary);
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  font-size: 2.25rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-title p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  border: 1px solid transparent;
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-light);
}

.feature-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  color: #ffffff;
}

.feature-icon.lessons {
  background: var(--gradient-primary);
}

.feature-icon.exercises {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.feature-icon.progress {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.feature-card h4 {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ==================== Lesson Cards ==================== */
.lessons-section {
  padding: 3rem 0;
}

.filter-sidebar {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 100px;
}

.filter-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-color);
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: block;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-family: inherit;
  transition: all var(--transition-fast);
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.lesson-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.lesson-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.lesson-image {
  height: 160px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.lesson-image i {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.3);
}

.lesson-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
}

.lesson-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--secondary-color);
  color: #ffffff;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}

.lesson-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.lesson-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.lesson-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  flex: 1;
}

.lesson-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bg-tertiary);
}

.lesson-meta span {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.lesson-meta i {
  color: var(--primary-color);
}

/* ==================== Exercise Cards ==================== */
.exercises-section {
  padding: 3rem 0;
}

.exercise-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  margin-bottom: 1.5rem;
  border-right: 4px solid var(--primary-color);
}

.exercise-card:hover {
  box-shadow: var(--shadow-lg);
}

.exercise-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.exercise-number {
  background: var(--primary-color);
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.exercise-difficulty {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}

.exercise-difficulty.easy {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.exercise-difficulty.medium {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
}

.exercise-difficulty.hard {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}

.exercise-question {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.exercise-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.exercise-option {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 2px solid transparent;
}

.exercise-option:hover {
  background: rgba(37, 99, 235, 0.05);
  border-color: var(--primary-light);
}

.exercise-option input[type="radio"] {
  margin-left: 0.75rem;
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

.exercise-option.selected {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--primary-color);
}

.exercise-option.correct {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--success-color);
}

.exercise-option.wrong {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger-color);
}

.numeric-input {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.numeric-input input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-family: inherit;
  text-align: center;
  transition: all var(--transition-fast);
}

.numeric-input input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.exercise-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
}

.progress-bar-container {
  background: var(--bg-tertiary);
  border-radius: var(--radius-xl);
  height: 10px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  transition: width var(--transition-normal);
}

/* ==================== Authentication Pages ==================== */
.auth-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--gradient-hero);
  padding: 2rem 0;
  position: relative;
}

.auth-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.auth-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  max-width: 450px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.auth-header {
  background: var(--gradient-primary);
  padding: 2rem;
  text-align: center;
}

.auth-header h2 {
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.auth-body {
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  transition: all var(--transition-fast);
  background: var(--bg-secondary);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.input-group {
  position: relative;
}

.input-group i {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.input-group .form-control {
  padding-right: 2.5rem;
}

.auth-footer {
  text-align: center;
  padding: 1.5rem 2rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--bg-tertiary);
}

.auth-footer p {
  margin: 0;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary-color);
  font-weight: 600;
}

.social-login {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.social-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all var(--transition-fast);
  border: 2px solid var(--bg-tertiary);
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
}

.social-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.social-btn.google:hover {
  border-color: #db4437;
  color: #db4437;
}

.social-btn.facebook:hover {
  border-color: #4267b2;
  color: #4267b2;
}

.social-btn.twitter:hover {
  border-color: #1da1f2;
  color: #1da1f2;
}

/* ==================== Footer ==================== */
.footer {
  background: var(--text-primary);
  color: #ffffff;
  padding: 3rem 0 1.5rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h5 {
  color: #ffffff;
  font-size: 1.125rem;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-section h5::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40px;
  height: 2px;
  background: var(--secondary-color);
}

.footer-section p,
.footer-section a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.footer-section a {
  display: block;
  margin-bottom: 0.5rem;
  transition: all var(--transition-fast);
}

.footer-section a:hover {
  color: var(--secondary-color);
  padding-right: 0.5rem;
}

.footer-social {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.footer-social a:hover {
  background: var(--secondary-color);
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
  font-size: 0.9rem;
}

/* ==================== Utility Classes ==================== */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient {
  background: var(--gradient-primary);
}

.rounded-xl {
  border-radius: var(--radius-xl);
}

/* ==================== Responsive Styles ==================== */
@media (max-width: 992px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-section {
    min-height: auto;
    padding: 3rem 0;
  }

  .hero-image {
    display: none;
  }

  .filter-sidebar {
    position: static;
    margin-bottom: 2rem;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .navbar-brand {
    font-size: 1.5rem;
  }

  .section-title h2 {
    font-size: 1.75rem;
  }

  .feature-card {
    padding: 1.5rem;
  }

  .auth-card {
    margin: 1rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-section h5::after {
    right: 50%;
    transform: translateX(50%);
  }

  .footer-social {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 1.75rem;
  }

  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .exercise-actions {
    flex-direction: column;
  }

  .exercise-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==================== Animation Classes ==================== */
.fade-in {
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.pulse-effect {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.backdrop-blur {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}


.badge-glass {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5em 1em;
  border-radius: 50rem;
  font-weight: 500;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}


.slide-in-right {
  animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==================== Loading States ==================== */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==================== Scrollbar Styling ==================== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* ==================== Mobile Bottom Navbar ==================== */
.bottom-navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.5rem 1rem;
  z-index: 1040;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  padding-bottom: env(safe-area-inset-bottom, 0.5rem);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  width: 64px;
}

.bottom-nav-item i {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-nav-item.active {
  color: var(--primary-color);
}

.bottom-nav-item.active i {
  transform: translateY(-2px);
}

.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  background-color: var(--secondary-color);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

/* Floating Action Button in Navbar (Optional, usually for 'Add' or 'Play') */
.bottom-nav-fab {
  background: var(--gradient-primary);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 4px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transform: translateY(-20px);
  box-shadow: 0 8px 15px rgba(37, 99, 235, 0.4);
}

.bottom-nav-fab i {
  font-size: 1.5rem;
  margin: 0;
}

/* Adjust main content for bottom navbar on mobile */
@media (max-width: 991.98px) {
  body {
    padding-bottom: 80px;
    /* Height of bottom navbar + spacing */
  }

  .navbar-modern {
    display: none !important;
    /* Hide top navbar on mobile to avoid clutter */
  }
}

/* ==================== Mobile Auth Redesign ==================== */
.mobile-auth-container {
  padding: 1.5rem;
}

.mobile-auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.mobile-auth-logo {
  width: 80px;
  height: 80px;
  background: var(--gradient-primary);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: white;
  font-size: 2.5rem;
  box-shadow: var(--shadow-lg);
}

/* ==================== Force Desktop Mode ==================== */
.navbar-modern .navbar-collapse {
  display: flex !important;
  flex-basis: auto !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex: 1 !important;
  position: static !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-top: 0 !important;
}

.navbar-menu {
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.25rem !important;
  display: flex !important;
}

.nav-link-modern {
  padding: 0.4rem 0.5rem !important;
}

.navbar-actions {
  flex-direction: row !important;
  width: auto !important;
  gap: 1rem !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: none !important;
}

.navbar-toggle {
  display: none !important;
}

.bottom-navbar {
  display: none !important;
}

@media (max-width: 991px) {
  .navbar-modern .navbar-collapse {
    display: flex !important;
  }

  .navbar-actions {
    flex-direction: row !important;
  }

  .navbar-btn-modern,
  .user-dropdown-toggle {
    width: auto !important;
  }

  .nav-item-modern .d-lg-inline {
    display: inline !important;
  }

  .nav-item-modern .d-lg-none {
    display: none !important;
  }
}