:root {
  /* New vibrant color palette */
  --primary: #4361ee;
  --primary-light: #4895ef;
  --secondary: #3f37c9;
  --accent: #f72585;
  --success: #4cc9f0;
  --warning: #f8961e;
  --danger: #ef233c;
  --dark: #2b2d42;
  --light: #f8f9fa;
  --gray: #adb5bd;
  --light-gray: #e9ecef;

  /* New gradient definitions */
  --primary-gradient: linear-gradient(135deg, var(--primary), var(--primary-light));
  --accent-gradient: linear-gradient(135deg, var(--accent), #b5179e);
  --success-gradient: linear-gradient(135deg, var(--success), #4895ef);
  
  /* Spacing variables */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.1);
}

/* Base Styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--light);
  color: var(--dark);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--dark);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--secondary);
}

/* Card Styles - Modern and Clean */
.content-card {
  background: white;
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.content-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-body {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.card-title {
  font-weight: 700;
  color: var(--dark);
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.4;
}

.card-text {
  color: var(--gray);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Badge Styles - Modern and Clean */
.badge {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.badge-quiz {
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
}

.badge-mcq {
  background: rgba(63, 55, 201, 0.1);
  color: var(--secondary);
}

.badge-note {
  background: rgba(76, 201, 240, 0.1);
  color: var(--success);
}

/* Button Styles - Modern and Clean */
.btn {
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-accent:hover {
  background: #b5179e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(247, 37, 133, 0.3);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #3a86ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 201, 240, 0.3);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--light-gray);
  color: var(--dark);
}

.btn-outline:hover {
  background: var(--light-gray);
  border-color: var(--gray);
}

/* Metadata Styles - Clean and Modern */
.metadata {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.meta-item {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
}

.meta-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--space-sm);
  flex-shrink: 0;
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary);
}

.meta-text {
  color: var(--gray);
}

.meta-value {
  font-weight: 600;
  color: var(--dark);
}

/* Search Styles - Modern */
.search-box {
  max-width: 700px;
  margin: 0 auto var(--space-xl);
  position: relative;
}

.search-box .form-control {
  border-radius: 50px;
  padding: var(--space-md) var(--space-lg) var(--space-md) 3rem;
  border: 2px solid var(--light-gray);
  font-size: 1rem;
  transition: all 0.3s;
  width: 100%;
}

.search-box .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

.search-box .search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 1.25rem;
}

/* Empty State - Clean */
.empty-state {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-md);
  margin: var(--space-xl) 0;
}

.empty-state i {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: var(--space-md);
  display: inline-block;
}

.empty-state h3 {
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--dark);
}

.empty-state p {
  color: var(--gray);
  margin-bottom: var(--space-lg);
  font-size: 1.05rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Modal Styles - Modern */
.modal-content {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  border-bottom: 1px solid var(--light-gray);
  padding: var(--space-lg);
}

/* Animations */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Urdu Content Styles */
.urdu-content {
  font-family: 'Noto Nastaliq Urdu', serif;
  direction: rtl;
  text-align: right;
}

.urdu-content .card-title,
.urdu-content .card-text,
.urdu-content .card-body {
  font-family: 'Noto Nastaliq Urdu', serif !important;
  direction: rtl;
  text-align: right;
}

.urdu-content .d-flex {
  direction: ltr;
}

.urdu-input {
  direction: rtl;
  text-align: right;
  font-family: 'Noto Nastaliq Urdu', serif;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  :root {
    --space-md: 0.75rem;
    --space-lg: 1.25rem;
    --space-xl: 1.5rem;
  }
  
  .card-body {
    padding: var(--space-md);
  }
  
  .empty-state {
    padding: var(--space-lg);
  }
  
  .search-box .form-control {
    padding-left: 2.5rem;
  }
  
  .search-box .search-icon {
    left: 1rem;
  }
}

/* Loading Spinner */
.spinner-border {
  width: 1.25rem;
  height: 1.25rem;
  border-width: 0.2em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}

/* Utility Classes */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

.mt-auto {
  margin-top: auto;
}

.text-center {
  text-align: center;
}