/* ===== VARIABLES ===== */
:root {
  --primary-color: #F4C542;
  --secondary-color: #1E1E1E;
  --background-color: #FFF8E7;
  --white: #FFFFFF;
  --text-color: #333333;
  --light-gray: #F5F5F5;
  --dark-gray: #666666;
  --success-color: #28a745;
  --error-color: #dc3545;
  --border-radius: 8px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --box-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s ease;
  --transition-slow: all 0.5s ease;
  --container-width: 1200px;
  --header-height: 80px;
}

/* ===== RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Tajawal', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  direction: rtl;
  overflow-x: hidden;
}

/* ===== LAYOUT ===== */
.container {
  width: 90%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 15px;
}

.section {
  padding: 5rem 0;
}

.section-sm {
  padding: 3rem 0;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--secondary-color);
}

h1 {
  font-size: 3rem;
}

h2 {
  font-size: 2.5rem;
}

h3 {
  font-size: 2rem;
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
}

.highlight {
  color: var(--primary-color);
}

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

.text-left {
  text-align: right;
}

.text-right {
  text-align: left;
}

/* ===== HEADER & NAVIGATION ===== */
.header {
  background-color: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  transition: var(--transition);
}

.header.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

.navbar {
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--secondary-color);
  font-weight: 700;
  font-size: 1.5rem;
  transition: var(--transition);
}

.nav-logo:hover {
  transform: translateY(-2px);
}

.nav-logo i {
  margin-left: 10px;
  color: var(--primary-color);
  font-size: 1.8rem;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 0.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  position: relative;
}

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  right: 50%;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: var(--transition);
  transform: translateX(50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
}

.bar {
  width: 25px;
  height: 3px;
  background-color: var(--secondary-color);
  margin: 3px 0;
  transition: var(--transition);
  border-radius: 2px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: var(--transition-slow);
}

.btn:hover::before {
  right: 100%;
}

.btn-primary {
  background-color: var(--secondary-color);
  color: var(--white);
}

.btn-primary:hover {
  background-color: #333333;
  transform: translateY(-3px);
  box-shadow: var(--box-shadow-hover);
}

.btn-secondary {
  background-color: var(--primary-color);
  color: var(--white);
}

.btn-secondary:hover {
  background-color: #e6b63c;
  transform: translateY(-3px);
  box-shadow: var(--box-shadow-hover);
}

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

.btn-outline:hover {
  background-color: var(--primary-color);
  color: var(--white);
  transform: translateY(-3px);
}

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

.btn-white:hover {
  background-color: #f8f9fa;
  transform: translateY(-3px);
  box-shadow: var(--box-shadow-hover);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ===== HERO SECTION ===== */
.hero {
  padding: calc(var(--header-height) + 2rem) 0 5rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, #FFD166 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,213.3C672,192,768,128,864,128C960,128,1056,192,1152,192C1248,192,1344,128,1392,96L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
  background-size: cover;
  background-position: center;
  opacity: 0.2;
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  position: relative;
  z-index: 1;
}

.hero-content {
  flex: 1;
  animation: fadeInUp 1s ease-out;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  color: var(--secondary-color);
}

.hero-description {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: var(--secondary-color);
  opacity: 0.9;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-image {
  flex: 1;
  text-align: center;
  animation: fadeIn 1.5s ease-out;
}

.hero-image i {
  font-size: 15rem;
  color: var(--white);
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
}

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  height: 100%;
}

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

.card-header {
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.card-body {
  margin-bottom: 1.5rem;
}

.card-footer {
  margin-top: auto;
}

/* Feature Card */
.feature-card {
  text-align: center;
  padding: 2.5rem 2rem;
}

.feature-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background-color: var(--background-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.feature-card:hover .feature-icon {
  background-color: var(--primary-color);
  transform: scale(1.1);
}

.feature-icon i {
  font-size: 2.5rem;
  color: var(--primary-color);
  transition: var(--transition);
}

.feature-card:hover .feature-icon i {
  color: var(--white);
}

.feature-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.feature-description {
  color: var(--text-color);
  opacity: 0.8;
}

/* Pricing Card */
.pricing-card {
  text-align: center;
  position: relative;
  border: 2px solid transparent;
}

.pricing-card.featured {
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.pricing-card.featured::before {
  content: 'الأكثر شهرة';
  position: absolute;
  top: -12px;
  right: 50%;
  transform: translateX(50%);
  background: var(--primary-color);
  color: var(--white);
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.plan-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: var(--background-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plan-icon i {
  font-size: 2.5rem;
  color: var(--primary-color);
}

.plan-name {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.plan-price {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.plan-period {
  font-size: 1rem;
  color: var(--text-color);
  opacity: 0.7;
  margin-bottom: 2rem;
}

.plan-features {
  list-style: none;
  margin-bottom: 2.5rem;
  text-align: right;
}

.plan-features li {
  padding: 0.75rem 0;
  position: relative;
  padding-right: 2rem;
  border-bottom: 1px solid var(--light-gray);
}

.plan-features li:last-child {
  border-bottom: none;
}

.plan-features li::before {
  content: "✓";
  position: absolute;
  right: 0;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.1rem;
}

.plan-features li.disabled {
  opacity: 0.5;
}

.plan-features li.disabled::before {
  content: "✕";
  color: var(--error-color);
}

/* Testimonial Card */
.testimonial-card {
  position: relative;
}

.testimonial-card.featured {
  border: 2px solid var(--primary-color);
}

.testimonial-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.user-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 1rem;
  flex-shrink: 0;
}

.user-avatar i {
  font-size: 2rem;
  color: var(--white);
}

.user-info {
  flex: 1;
}

.user-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.user-course {
  font-size: 0.9rem;
  color: var(--primary-color);
  font-weight: 500;
}

.rating {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.star {
  color: #FFD700;
  font-size: 1.1rem;
}

.testimonial-content {
  margin-bottom: 1.5rem;
}

.testimonial-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-color);
  opacity: 0.8;
  font-style: italic;
  position: relative;
  padding-right: 1.5rem;
}

.testimonial-text::before {
  content: '"';
  font-size: 3rem;
  color: var(--primary-color);
  position: absolute;
  right: -0.5rem;
  top: -1rem;
  opacity: 0.3;
}

.testimonial-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.7;
}

/* ===== GRID SYSTEM ===== */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--secondary-color);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--light-gray);
  border-radius: var(--border-radius);
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  transition: var(--transition);
  background: var(--white);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(244, 197, 66, 0.1);
}

.form-control.error {
  border-color: var(--error-color);
}

.form-text {
  font-size: 0.875rem;
  color: var(--dark-gray);
  margin-top: 0.25rem;
}

.form-text.error {
  color: var(--error-color);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ===== UTILITY CLASSES ===== */
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-white { color: var(--white); }
.text-muted { color: var(--dark-gray); }

.bg-primary { background-color: var(--primary-color); }
.bg-secondary { background-color: var(--secondary-color); }
.bg-white { background-color: var(--white); }
.bg-light { background-color: var(--light-gray); }

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

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

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: var(--border-radius); }
.rounded-circle { border-radius: 50%; }

.shadow { box-shadow: var(--box-shadow); }
.shadow-lg { box-shadow: var(--box-shadow-hover); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0,0,0);
  }
  40%, 43% {
    transform: translate3d(0,-15px,0);
  }
  70% {
    transform: translate3d(0,-7px,0);
  }
  90% {
    transform: translate3d(0,-3px,0);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Animation Classes */
.animate-fade-in { animation: fadeIn 1s ease; }
.animate-fade-in-up { animation: fadeInUp 1s ease; }
.animate-fade-in-down { animation: fadeInDown 1s ease; }
.animate-fade-in-left { animation: fadeInLeft 1s ease; }
.animate-fade-in-right { animation: fadeInRight 1s ease; }
.animate-bounce { animation: bounce 2s infinite; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-shake { animation: shake 0.5s ease; }

/* Scroll Animation */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.scroll-animate.animated {
  opacity: 1;
  transform: translateY(0);
}

/* ===== LOADING ===== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: var(--white);
  animation: spin 1s ease-in-out infinite;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
}

.toast {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--box-shadow-hover);
  border-right: 4px solid var(--primary-color);
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success {
  border-right-color: var(--success-color);
}

.toast.error {
  border-right-color: var(--error-color);
}

.toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.toast-title {
  font-weight: 600;
  font-size: 1rem;
}

.toast-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--dark-gray);
  transition: var(--transition);
}

.toast-close:hover {
  color: var(--secondary-color);
}

.toast-body {
  color: var(--text-color);
}