/* Enhanced Moroccan Theme Variables */
:root {
  /* Authentic Moroccan Colors */
  --moroccan-red: #d2001f;
  --moroccan-green: #006233;
  --moroccan-gold: #ffd700;
  --moroccan-orange: #ff6b35;
  --moroccan-blue: #1e40af;
  --moroccan-burgundy: #8b0000;
  --moroccan-emerald: #10b981;
  --moroccan-amber: #f59e0b;

  /* Modern Accent Colors */
  --accent-pink: #ec4899;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-lime: #84cc16;

  /* Light Theme */
  --bg-primary: linear-gradient(135deg, #fef7ed 0%, #fdf2f8 100%);
  --bg-secondary: rgba(255, 255, 255, 0.8);
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.25);
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-accent: #374151;
  --border-color: rgba(209, 213, 219, 0.3);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);

  /* Enhanced Gradients */
  --gradient-primary: linear-gradient(
    135deg,
    var(--moroccan-red) 0%,
    var(--moroccan-orange) 50%,
    var(--moroccan-amber) 100%
  );
  --gradient-secondary: linear-gradient(135deg, var(--moroccan-green) 0%, var(--moroccan-emerald) 100%);
  --gradient-gold: linear-gradient(135deg, var(--moroccan-gold) 0%, var(--moroccan-amber) 100%);
  --gradient-success: linear-gradient(135deg, var(--moroccan-emerald) 0%, var(--accent-lime) 100%);
  --gradient-danger: linear-gradient(135deg, var(--moroccan-red) 0%, var(--accent-pink) 100%);
  --gradient-hero: linear-gradient(
    135deg,
    var(--moroccan-red) 0%,
    var(--moroccan-burgundy) 25%,
    var(--moroccan-green) 75%,
    var(--moroccan-emerald) 100%
  );
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --bg-secondary: rgba(30, 41, 59, 0.8);
  --bg-card: rgba(30, 41, 59, 0.95);
  --bg-glass: rgba(30, 41, 59, 0.25);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-accent: #e2e8f0;
  --border-color: rgba(71, 85, 105, 0.3);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Arabic Font Support */
[lang="ar"],
.arabic-text {
  font-family: "Amiri", serif;
  direction: rtl;
  text-align: right;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Enhanced Header */
.header {
  background: var(--gradient-hero);
  color: white;
  padding: 1.5rem 0;
  box-shadow: var(--shadow-xl);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header::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='M30 30l15-15v30l-15-15zm-15 0l15 15H0l15-15z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")
    repeat;
  opacity: 0.1;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: slideInLeft 0.8s ease-out;
}

.logo i {
  font-size: 2.5rem;
  color: var(--moroccan-gold);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  animation: bounce 2s infinite;
}

.logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  background: linear-gradient(45deg, white, var(--moroccan-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-controls {
  display: flex;
  gap: 0.75rem;
  animation: slideInRight 0.8s ease-out;
}

.theme-toggle,
.lang-toggle {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.75rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.theme-toggle::before,
.lang-toggle::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.theme-toggle:hover::before,
.lang-toggle:hover::before {
  left: 100%;
}

.theme-toggle:hover,
.lang-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.lang-text {
  font-size: 0.875rem;
  font-weight: 600;
}

/* Main Content */
.main {
  padding: 3rem 0;
  min-height: calc(100vh - 200px);
  position: relative;
}

.main::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23D2001F' fill-opacity='0.02'%3E%3Cpath d='M50 50l25-25v50l-25-25zm-25 0l25 25H0l25-25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")
    repeat;
  pointer-events: none;
}

/* Enhanced Ad Banner */
.ad-banner {
  background: var(--gradient-gold);
  color: var(--text-primary);
  padding: 1.5rem;
  border-radius: 20px;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  animation: slideInDown 0.8s ease-out;
}

.ad-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: rotate 10s linear infinite;
}

.ad-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1.1rem;
  position: relative;
  z-index: 2;
}

.ad-content i {
  font-size: 1.5rem;
  animation: pulse 2s infinite;
}

/* Enhanced Calculator Card */
.calculator-card {
  background: var(--bg-card);
  border-radius: 24px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  position: relative;
  animation: slideInUp 0.8s ease-out;
}

.calculator-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.card-header {
  background: var(--gradient-secondary);
  color: white;
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.card-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M40 40l20-20v40l-20-20zm-20 0l20 20H0l20-20z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")
    repeat;
}

.card-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 1s ease-out 0.3s both;
}

.moroccan-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.1;
  background-image: radial-gradient(circle at 25% 25%, var(--moroccan-gold) 3px, transparent 3px),
    radial-gradient(circle at 75% 75%, var(--moroccan-gold) 3px, transparent 3px),
    radial-gradient(circle at 25% 75%, var(--moroccan-gold) 2px, transparent 2px),
    radial-gradient(circle at 75% 25%, var(--moroccan-gold) 2px, transparent 2px);
  background-size: 60px 60px, 60px 60px, 40px 40px, 40px 40px;
  background-position: 0 0, 30px 30px, 0 0, 20px 20px;
  animation: patternMove 20s linear infinite;
}

.card-body {
  padding: 3rem 2rem;
  position: relative;
}

/* Enhanced Form Styles */
.form-group {
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease-out;
}

.form-group label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.1rem;
  position: relative;
}

.form-group label::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 30px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.form-control {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
}

.form-control:focus {
  outline: none;
  border-color: var(--moroccan-red);
  box-shadow: 0 0 0 4px rgba(210, 0, 31, 0.1);
  transform: translateY(-2px);
  background: white;
}

.form-control:hover {
  border-color: var(--moroccan-orange);
  transform: translateY(-1px);
}

/* Enhanced Subjects Container */
.subjects-container {
  margin-bottom: 2rem;
}

.subject-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-glass);
  border-radius: 20px;
  border-left: 5px solid var(--moroccan-red);
  backdrop-filter: blur(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: slideInLeft 0.6s ease-out;
}

.subject-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(210, 0, 31, 0.05) 0%, rgba(255, 107, 53, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.subject-row:hover::before {
  opacity: 1;
}

.subject-row:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-left-color: var(--moroccan-orange);
}

.subject-row:nth-child(even) {
  border-left-color: var(--moroccan-green);
  animation-delay: 0.1s;
}

.subject-row:nth-child(3n) {
  border-left-color: var(--moroccan-gold);
  animation-delay: 0.2s;
}

/* Enhanced Calculate Button */
.calculate-btn {
  width: 100%;
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 1.25rem 2rem;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: var(--shadow-lg);
}

.calculate-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.calculate-btn:hover::before {
  left: 100%;
}

.calculate-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.calculate-btn:active {
  transform: translateY(-1px) scale(0.98);
}

.calculate-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.calculate-btn i {
  font-size: 1.3rem;
  animation: bounce 1s infinite;
}

/* Enhanced Result Container */
.result-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 3rem 2rem;
  text-align: center;
  border: 3px solid var(--moroccan-gold);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-xl);
}

.result-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--gradient-gold);
}

.result-card::after {
  content: "🎉";
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2rem;
  animation: bounce 1s infinite;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.result-header i {
  color: var(--moroccan-gold);
  font-size: 2rem;
  animation: pulse 2s infinite;
}

.result-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
}

.result-score {
  font-size: 4rem;
  font-weight: 900;
  color: var(--moroccan-red);
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: scoreReveal 1s ease-out;
}

.result-status {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 2rem;
  padding: 1rem 2rem;
  border-radius: 50px;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.result-status::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

.result-status.success {
  background: var(--gradient-success);
  color: white;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.result-status.failure {
  background: var(--gradient-danger);
  color: white;
  box-shadow: 0 8px 25px rgba(210, 0, 31, 0.3);
}

/* Enhanced Share Button */
.share-btn {
  background: var(--gradient-secondary);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 16px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.share-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.share-btn:hover::before {
  left: 100%;
}

.share-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-lg);
}

.share-btn i {
  animation: bounce 1s infinite;
}

/* Enhanced Info Card */
.info-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  border-left: 6px solid var(--moroccan-blue);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  animation: slideInUp 0.8s ease-out 0.4s both;
}

.info-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, var(--moroccan-blue) 2px, transparent 2px);
  background-size: 20px 20px;
  opacity: 0.1;
}

.info-card h3 {
  color: var(--moroccan-blue);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.4rem;
  font-weight: 700;
}

.info-card h3::before {
  content: "💡";
  font-size: 1.5rem;
  animation: pulse 2s infinite;
}

.info-card ul {
  list-style: none;
}

.info-card li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  padding-left: 2rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.info-card li:hover {
  color: var(--moroccan-blue);
  transform: translateX(5px);
}

.info-card li:last-child {
  border-bottom: none;
}

.info-card li::before {
  content: "✨";
  position: absolute;
  left: 0;
  font-size: 1.2rem;
  animation: twinkle 2s infinite;
}

/* Enhanced Footer */
.footer {
  background: var(--bg-secondary);
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
  backdrop-filter: blur(20px);
  position: relative;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 1.1rem;
}

.footer-logo i {
  color: var(--moroccan-red);
  font-size: 1.3rem;
  animation: heartbeat 2s infinite;
}

/* Enhanced Install Button */
.install-btn {
  background: var(--gradient-gold);
  color: var(--text-primary);
  border: none;
  padding: 1rem 2rem;
  border-radius: 16px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.install-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.install-btn:hover::before {
  left: 100%;
}

.install-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-lg);
}

.install-btn i {
  animation: bounce 1s infinite;
}

/* Enhanced Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.loading-spinner {
  text-align: center;
  color: white;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top: 4px solid var(--moroccan-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 2rem;
  position: relative;
}

.spinner::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: var(--moroccan-gold);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: pulse 1s infinite;
}

.loading-spinner p {
  font-size: 1.2rem;
  font-weight: 600;
  animation: pulse 2s infinite;
}

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

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

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

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

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

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

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

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

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

@keyframes scoreReveal {
  from {
    opacity: 0;
    transform: scale(0.5) rotateY(180deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
  }
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes patternMove {
  0% {
    background-position: 0 0, 30px 30px, 0 0, 20px 20px;
  }
  100% {
    background-position: 60px 60px, 90px 90px, 40px 40px, 60px 60px;
  }
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .header {
    padding: 1rem 0;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .logo h1 {
    font-size: 1.5rem;
  }

  .logo i {
    font-size: 2rem;
  }

  .card-header {
    padding: 2rem 1.5rem;
  }

  .card-header h2 {
    font-size: 1.5rem;
  }

  .card-body {
    padding: 2rem 1.5rem;
  }

  .subject-row {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.25rem;
  }

  .result-score {
    font-size: 3rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .calculate-btn {
    font-size: 1.1rem;
    padding: 1rem 1.5rem;
  }

  .info-card {
    padding: 2rem;
  }
}

@media (max-width: 480px) {
  .main {
    padding: 2rem 0;
  }

  .card-header {
    padding: 1.5rem 1rem;
  }

  .card-header h2 {
    font-size: 1.25rem;
  }

  .card-body {
    padding: 1.5rem 1rem;
  }

  .result-score {
    font-size: 2.5rem;
  }

  .result-status {
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
  }

  .ad-banner {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }

  .info-card {
    padding: 1.5rem;
  }
}

/* Print Styles */
@media print {
  .header,
  .footer,
  .ad-banner,
  .share-btn,
  .install-btn,
  .header-controls {
    display: none;
  }

  .calculator-card {
    box-shadow: none;
    border: 2px solid #000;
  }

  .result-card {
    border: 2px solid var(--moroccan-gold);
  }

  * {
    animation: none !important;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  }

  .form-control {
    border-width: 3px;
  }
}

/* Ad Container Styles */
.ad-container {
  margin: 2rem 0;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.ad-label {
  background: var(--gradient-gold);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  opacity: 0.8;
}

/* Top Banner Ad */
.top-banner {
  margin-bottom: 2rem;
  animation: slideInDown 0.8s ease-out;
}

.top-banner .adsbygoogle {
  min-height: 90px;
  display: block;
}

/* Sidebar Ad */
.sidebar-ad {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  z-index: 50;
  animation: slideInRight 1s ease-out 2s both;
}

/* Hide sidebar ad on mobile */
@media (max-width: 1400px) {
  .sidebar-ad {
    display: none;
  }
}

/* Mobile Banner Ad */
.mobile-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: white;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-banner .adsbygoogle {
  min-height: 50px;
  display: block;
}

/* Native Ad */
.native-ad {
  margin: 2rem 0;
  animation: fadeInUp 0.8s ease-out;
}

.native-ad-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  transition: all 0.3s ease;
  cursor: pointer;
}

.native-ad-content:hover {
  background: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.native-ad-image {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.native-ad-text {
  flex: 1;
}

.native-ad-text h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.native-ad-text p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.native-ad-cta {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.native-ad-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Fallback Ad Styles */
.fallback-ad {
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--moroccan-green), var(--moroccan-emerald));
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.fallback-ad::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 3s infinite;
}

.fallback-ad .ad-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

.fallback-ad .ad-content.vertical {
  flex-direction: column;
  text-align: center;
}

.fallback-ad i {
  font-size: 2rem;
  color: var(--moroccan-gold);
  margin-bottom: 0.5rem;
}

.fallback-ad .ad-text h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.fallback-ad .ad-text p {
  font-size: 0.9rem;
  opacity: 0.9;
}

.fallback-ad .ad-cta {
  background: var(--moroccan-gold);
  color: var(--text-primary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fallback-ad .ad-cta:hover {
  background: var(--moroccan-amber);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Interstitial Ad Overlay */
.interstitial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.interstitial-content {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2rem;
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  animation: scaleIn 0.3s ease-out;
}

.interstitial-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--moroccan-red);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.interstitial-close:hover {
  background: var(--moroccan-burgundy);
  transform: scale(1.1);
}

/* Ad Blocker Detection */
.ad-blocker-notice {
  background: var(--gradient-danger);
  color: white;
  padding: 1rem;
  border-radius: 12px;
  margin: 1rem 0;
  text-align: center;
  animation: pulse 2s infinite;
}

.ad-blocker-notice h4 {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.ad-blocker-notice p {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Sticky Ad Controls */
.ad-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ad-control-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.ad-control-btn:hover {
  background: var(--moroccan-red);
  color: white;
  transform: scale(1.1);
}

/* Responsive Ad Adjustments */
@media (max-width: 768px) {
  .ad-container {
    margin: 1rem 0;
  }

  .native-ad-content {
    flex-direction: column;
    text-align: center;
  }

  .fallback-ad .ad-content {
    flex-direction: column;
    text-align: center;
  }

  .sidebar-ad {
    display: none;
  }
}

/* Animation for ads */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Official Calculation System Styles */
.subject-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--moroccan-gold);
}

.subject-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.coefficient-badge {
  background: var(--gradient-gold);
  color: var(--text-primary);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.subject-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.subject-row {
  display: block;
  grid-template-columns: none;
  padding: 2rem;
  margin-bottom: 2rem;
  background: var(--bg-glass);
  border-radius: 20px;
  border-left: 5px solid var(--moroccan-red);
  backdrop-filter: blur(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: slideInLeft 0.6s ease-out;
}

.subject-row:nth-child(even) {
  border-left-color: var(--moroccan-green);
}

.subject-row:nth-child(3n) {
  border-left-color: var(--moroccan-blue);
}

.subject-row:nth-child(4n) {
  border-left-color: var(--moroccan-orange);
}

/* Calculation Breakdown Styles */
.calculation-breakdown {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  border: 2px solid var(--moroccan-gold);
  animation: fadeInUp 0.8s ease-out;
}

.calculation-breakdown h4 {
  color: var(--moroccan-blue);
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.calculation-breakdown h4::before {
  content: "📊";
  font-size: 1.3rem;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 1rem;
}

.breakdown-item:last-of-type {
  border-bottom: none;
}

.breakdown-item span {
  color: var(--text-secondary);
  font-weight: 500;
}

.breakdown-item strong {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.breakdown-formula {
  background: var(--gradient-primary);
  color: white;
  padding: 1rem;
  border-radius: 12px;
  margin-top: 1rem;
  text-align: center;
}

.breakdown-formula span {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.formula-display {
  font-family: "Courier New", monospace;
  font-size: 1.1rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.75rem;
  border-radius: 8px;
  letter-spacing: 1px;
}

/* Component Input Styling */
.continu-input {
  border-left: 4px solid var(--moroccan-green);
}

.regional-input {
  border-left: 4px solid var(--moroccan-blue);
}

.national-input {
  border-left: 4px solid var(--moroccan-red);
}

.continu-input:focus {
  border-color: var(--moroccan-green);
  box-shadow: 0 0 0 4px rgba(0, 98, 51, 0.1);
}

.regional-input:focus {
  border-color: var(--moroccan-blue);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
}

.national-input:focus {
  border-color: var(--moroccan-red);
  box-shadow: 0 0 0 4px rgba(210, 0, 31, 0.1);
}

/* Progress Bar Enhancement */
.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 1rem;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-gold);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 2px;
}

/* Official Formula Display */
.official-formula {
  background: var(--gradient-secondary);
  color: white;
  padding: 1.5rem;
  border-radius: 16px;
  text-align: center;
  margin: 1rem 0;
  position: relative;
  overflow: hidden;
}

.official-formula::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 3s infinite;
}

.official-formula h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.official-formula p {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 0;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .subject-inputs {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .subject-row {
    padding: 1.5rem;
  }

  .subject-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .calculation-breakdown {
    padding: 1rem;
  }

  .breakdown-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .formula-display {
    font-size: 0.9rem;
    word-break: break-all;
  }
}

@media (max-width: 480px) {
  .subject-header h4 {
    font-size: 1rem;
  }

  .coefficient-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }

  .calculation-breakdown h4 {
    font-size: 1.1rem;
  }

  .breakdown-item {
    font-size: 0.9rem;
  }
}

/* Animation for new elements */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced result display */
.result-score {
  position: relative;
}

.result-score::after {
  content: "/20";
  font-size: 2rem;
  opacity: 0.7;
  margin-left: 0.5rem;
}

/* Official badge */
.official-badge {
  background: var(--gradient-gold);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.official-badge::before {
  content: "✓";
  font-size: 1rem;
  color: var(--moroccan-green);
}

/* Regional Prediction Tool Styles */
.prediction-tool {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  border-left: 6px solid var(--moroccan-blue);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  animation: slideInUp 0.8s ease-out;
}

.prediction-tool::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, var(--moroccan-blue) 2px, transparent 2px);
  background-size: 20px 20px;
  opacity: 0.1;
}

.tool-header {
  text-align: center;
  margin-bottom: 2rem;
}

.tool-header i {
  font-size: 2.5rem;
  color: var(--moroccan-blue);
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

.tool-header h3 {
  color: var(--moroccan-blue);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tool-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0;
}

.prediction-input-section {
  max-width: 400px;
  margin: 0 auto;
}

.input-with-preview {
  position: relative;
}

.regional-score-input {
  border-left: 4px solid var(--moroccan-blue);
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
}

.regional-score-input:focus {
  border-color: var(--moroccan-blue);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
}

.prediction-preview-container {
  margin-top: 1rem;
  min-height: 40px;
}

.prediction-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  animation: fadeInUp 0.3s ease-out;
}

.prediction-preview.success {
  background: var(--gradient-success);
  color: white;
}

.prediction-preview.danger {
  background: var(--gradient-danger);
  color: white;
}

.predict-btn {
  width: 100%;
  background: var(--gradient-secondary);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow);
}

.predict-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.predict-btn:hover::before {
  left: 100%;
}

.predict-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.predict-btn i {
  font-size: 1.2rem;
  animation: bounce 1s infinite;
}

/* Prediction Results Styles */
.prediction-container {
  margin: 2rem 0;
  animation: slideInUp 0.8s ease-out;
}

.prediction-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--shadow-xl);
  border: 3px solid var(--moroccan-blue);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.prediction-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--gradient-secondary);
}

.prediction-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  text-align: center;
}

.prediction-header i {
  color: var(--moroccan-blue);
  font-size: 2rem;
  animation: pulse 2s infinite;
}

.prediction-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--moroccan-blue);
}

.regional-display {
  text-align: center;
  padding: 1rem 2rem;
  background: var(--gradient-secondary);
  color: white;
  border-radius: 16px;
  margin-bottom: 2rem;
  font-size: 1.2rem;
}

.regional-display strong {
  font-size: 1.5rem;
  margin-left: 0.5rem;
}

.prediction-targets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.prediction-target {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 1.5rem;
  border-left: 5px solid var(--moroccan-green);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.prediction-target::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(132, 204, 22, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.prediction-target:hover::before {
  opacity: 1;
}

.prediction-target:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.prediction-target.achievable {
  border-left-color: var(--moroccan-emerald);
}

.prediction-target.moderate {
  border-left-color: var(--moroccan-gold);
}

.prediction-target.difficult {
  border-left-color: var(--moroccan-orange);
}

.prediction-target.very-difficult {
  border-left-color: var(--moroccan-red);
}

.prediction-target.impossible {
  border-left-color: var(--moroccan-burgundy);
  opacity: 0.7;
}

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

.target-label {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.status-icon {
  font-size: 1.5rem;
}

.target-requirements {
  space-y: 0.5rem;
}

.requirement-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.requirement-item:last-of-type {
  border-bottom: none;
}

.requirement-item span {
  color: var(--text-secondary);
  font-weight: 500;
}

.requirement-item strong {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.status-text {
  text-align: center;
  padding: 0.75rem;
  margin-top: 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.achievable .status-text {
  background: var(--gradient-success);
  color: white;
}

.moderate .status-text {
  background: var(--gradient-gold);
  color: var(--text-primary);
}

.difficult .status-text {
  background: var(--gradient-primary);
  color: white;
}

.very-difficult .status-text {
  background: var(--gradient-danger);
  color: white;
}

.impossible .status-text {
  background: var(--moroccan-burgundy);
  color: white;
}

.prediction-formula {
  background: var(--bg-glass);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  border: 2px dashed var(--moroccan-blue);
}

.prediction-formula h4 {
  color: var(--moroccan-blue);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.prediction-formula p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.formula-note {
  background: var(--moroccan-blue);
  color: white;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-style: italic;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .prediction-tool {
    padding: 2rem 1.5rem;
  }

  .tool-header i {
    font-size: 2rem;
  }

  .tool-header h3 {
    font-size: 1.3rem;
  }

  .prediction-targets {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .prediction-target {
    padding: 1.25rem;
  }

  .prediction-card {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .prediction-tool {
    padding: 1.5rem 1rem;
  }

  .tool-header h3 {
    font-size: 1.2rem;
  }

  .tool-header p {
    font-size: 0.9rem;
  }

  .regional-display {
    font-size: 1rem;
  }

  .regional-display strong {
    font-size: 1.3rem;
  }

  .prediction-target {
    padding: 1rem;
  }

  .target-label {
    font-size: 1rem;
  }

  .requirement-item {
    font-size: 0.9rem;
  }
}

/* Animation for prediction elements */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* CC Option Container */
.cc-option-container {
  background: var(--bg-glass);
  border-radius: 16px;
  padding: 1.5rem;
  border-left: 4px solid var(--moroccan-blue);
  backdrop-filter: blur(20px);
}

.cc-checkbox-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.cc-checkbox {
  display: none;
}

.checkmark {
  width: 24px;
  height: 24px;
  border: 2px solid var(--moroccan-blue);
  border-radius: 6px;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.cc-checkbox:checked + .checkmark {
  background: var(--moroccan-blue);
  border-color: var(--moroccan-blue);
}

.cc-checkbox:checked + .checkmark::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 14px;
}

.checkbox-text {
  font-size: 1rem;
  user-select: none;
}

.cc-help-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  font-style: italic;
  line-height: 1.4;
}

/* Regional Info Message */
.regional-info-message {
  margin-bottom: 2rem;
  animation: slideInDown 0.6s ease-out;
}

.info-banner {
  background: var(--gradient-secondary);
  color: white;
  padding: 1.5rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-lg);
}

.info-banner i {
  font-size: 2rem;
  color: var(--moroccan-gold);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

.info-content h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.info-content p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.info-content strong {
  color: var(--moroccan-gold);
  font-weight: 700;
}

/* CC Input Styling */
.continu-2eme-input {
  border-left: 4px solid var(--moroccan-amber);
}

.continu-2eme-input:focus {
  border-color: var(--moroccan-amber);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .cc-option-container {
    padding: 1.25rem;
  }

  .cc-checkbox-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .info-banner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .info-banner i {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .cc-help-text {
    font-size: 0.8rem;
  }

  .checkbox-text {
    font-size: 0.9rem;
  }
}

/* Smart Prediction Tool Styles */
.smart-prediction-inputs {
  max-width: 600px;
  margin: 0 auto;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.cc2eme-score-input {
  border-left: 4px solid var(--moroccan-amber);
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
}

.cc2eme-score-input:focus {
  border-color: var(--moroccan-amber);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

.smart-predict-btn {
  width: 100%;
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow);
}

.smart-predict-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.smart-predict-btn:hover::before {
  left: 100%;
}

.smart-predict-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.smart-predict-btn i {
  font-size: 1.2rem;
  animation: pulse 2s infinite;
}

/* Smart Prediction Results */
.smart-prediction {
  border: 3px solid var(--moroccan-blue);
}

.provided-scores-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--gradient-secondary);
  color: white;
  border-radius: 16px;
}

.score-item {
  text-align: center;
  padding: 0.5rem;
}

.score-item span {
  display: block;
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}

.score-item strong {
  font-size: 1.3rem;
  color: var(--moroccan-gold);
}

.smart-predictions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.smart-prediction-item {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.25rem;
  border-left: 4px solid var(--moroccan-green);
  transition: all 0.3s ease;
}

.smart-prediction-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.smart-prediction-item.achievable {
  border-left-color: var(--moroccan-emerald);
}

.smart-prediction-item.difficult {
  border-left-color: var(--moroccan-red);
  opacity: 0.8;
}

/* Provided Scores Info */
.provided-scores-info {
  margin-bottom: 2rem;
  animation: slideInDown 0.6s ease-out;
}

.provided-scores-info .info-banner {
  background: var(--gradient-secondary);
  color: white;
  padding: 1.5rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-lg);
}

.provided-scores-info .info-banner i {
  font-size: 2rem;
  color: var(--moroccan-gold);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

.provided-scores-info .info-content h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.provided-scores-info .info-content p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.provided-scores-info .info-content strong {
  color: var(--moroccan-gold);
  font-weight: 700;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .input-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .provided-scores-display {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .smart-predictions-grid {
    grid-template-columns: 1fr;
  }

  .provided-scores-info .info-banner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}
