/* 
  Global Styles & Variables
  Theme: Modern Educational (Thanaweya Amma)
  Direction: RTL
*/

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&display=swap');

:root {
  /* Colors */
  /* Colors */

  --primary-color: #1eb3f5;
  /* Light Blue */
  --primary-dark: #1597d4;
  --secondary-color: #00bcd4;
  /* Cyan */
  --secondary-dark: #0097A7;
  --accent-color: #4DD0E1;

  --text-dark: #1F2937;
  --text-light: #6B7280;
  --text-white: #FFFFFF;

  --bg-body: #F9FAFB;
  --bg-white: #FFFFFF;
  --bg-light: #F3F4F6;

  /* Spacing */
  --section-padding: 4rem 1rem;
  --container-width: 1200px;

  /* Borders & Shadows */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.5rem;
  --shadow-sm: 0 1px 2px 0 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);

  /* Transitions */
  --transition: all 0.3s ease;
}

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

/* Image Protection (Global) */
img {
  -webkit-touch-callout: none;
  /* Disable long-press context menu on iOS */
  -webkit-user-select: none;
  /* Disable selection */
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  /* Disable native dragging */
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

textarea {
  resize: none;
}

/* App-Like Enhancements (Part 1) */


body {
  font-family: 'Cairo', sans-serif;
  /* Arabic Friendly Font */
  background-color: var(--bg-body);
  color: var(--text-dark);
  line-height: 1.6;
  direction: rtl;
  /* Right to Left for Arabic */
  text-align: right;
  overflow-x: hidden;
}

/* Premium Global Scrollbar */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border: 3px solid #f1f5f9;
  border-radius: 12px;
  transition: all 0.3s;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Firefox Support */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}


a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  cursor: pointer;
}


ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* Utilities */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: inherit;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--text-white);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.8rem;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

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

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

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.8rem;
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: var(--text-white);
}

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

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

.section-title {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-light);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 3rem auto;
}

/* Navbar */
.navbar {
  background-color: var(--bg-white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
  padding-top: calc(1rem + env(safe-area-inset-top));
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}

.brand-icon {
  height: clamp(35px, 8vw, 45px);
  width: auto;
  object-fit: contain;
}

.logo-text {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 900;
  color: var(--primary-color);
  line-height: 1;
}

.logo-accent {
  color: var(--secondary-color);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-dark);
  font-weight: 600;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-color);
}

.nav-links a.btn-primary {
  color: var(--text-white);
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-dark);
  /* Ensure visible on white */
  z-index: 1100;
  /* Higher than content */
}

/* Bottom Navigation Bar (Mobile App Feel) */
/* Bottom Navigation Removed */

/* Responsive Navbar */
@media (max-width: 865px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 68px;
    /* Adjust based on navbar height */
    right: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: var(--bg-white);
    border-top: 3px solid var(--primary-color);
    flex-direction: column;
    padding: 2rem;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
  }

  .nav-links.active {
    right: 0;
  }
}

/* Footer */
.footer {
  background-color: var(--text-dark);
  color: var(--text-white);
  padding: 4rem 0 1rem 0;
  margin-top: 4rem;
}

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

@media (max-width: 469px) {
  .footer-col {
    text-align: center;
  }

  .footer-col .logo {
    justify-content: center;
  }
}

.footer-col h3 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: var(--accent-color);
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: #D1D5DB;
}

.footer-links a:hover {
  color: var(--text-white);
  padding-right: 5px;
}

.copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  color: #9CA3AF;
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Components: Hero --- */
.hero {
  background: radial-gradient(at 0% 0%, hsla(199, 91%, 91%, 1) 0, transparent 50%),
    radial-gradient(at 50% 0%, hsla(187, 85%, 92%, 1) 0, transparent 50%),
    radial-gradient(at 100% 0%, hsla(199, 91%, 91%, 1) 0, transparent 50%);
  background-color: #f8fafc;
  padding: 8rem 0 0 0;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-bottom: 4rem;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

.hero-shape svg {
  display: block;
  width: 100%;
}

/* --- Components: Stats Bar (v403.05) --- */
.stats-bar {
  background: white;
  padding: 2rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 10;
  margin-top: -30px;
  /* Pull into hero slightly */
  border-radius: 24px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.stats-grid {
  display: flex;
  justify-content: space-around;
  align-items: center;
  text-align: center;
}

.stat-item {
  flex: 1;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 600;
}

.stats-bar .divider {
  width: 1px;
  height: 40px;
  background: #e2e8f0;
}

@media (max-width: 768px) {
  .stats-bar {
    margin: -20px 1.5rem 0 1.5rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }
}

/* --- Components: Sections & Grids --- */
.section {
  padding: var(--section-padding);
}

.bg-light {
  background-color: var(--bg-light);
}

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

/* --- Components: Cards --- */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:not(.card-admin):hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

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

.feature-card .icon-box {
  width: 70px;
  height: 70px;
  background-color: rgba(0, 137, 123, 0.1);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 1.5rem auto;
}

/* Premium Features Grid (Added v403.05) */
.features-grid-premium {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.icon-box-premium {
  width: 60px;
  height: 60px;
  background-color: rgba(30, 179, 245, 0.1);
  color: var(--primary-color);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1.2rem auto;
  transition: var(--transition);
}

.feature-card:hover .icon-box-premium {
  transform: scale(1.1) rotate(5deg);
}

.feature-card h3 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
}

.feature-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-light);
}

/* Modern Select Styling */
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: left 1rem center;
  /* Left for RTL */
  background-size: 1em;
  padding-left: 2.5rem;
  /* Space for arrow */
  padding-right: 1rem;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-dark);
}

select.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 137, 123, 0.1);
}

select.form-control option {
  color: var(--text-dark);
  padding: 0.5rem;
}

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

.feature-card p {
  color: var(--text-light);
}

/* --- Components: Steps --- */
.steps-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4rem 3rem;
  margin-top: 4rem;
  position: relative;
}

.step-item {
  text-align: center;
  position: relative;
  transition: var(--transition);
  z-index: 5;
}

.step-item:hover {
  transform: translateY(-5px);
}

.step-number {
  width: 55px;
  height: 55px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem auto;
  position: relative;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(30, 179, 245, 0.3);
  border: 4px solid var(--bg-body);
}

.step-item::after {
  content: '';
  position: absolute;
  top: 27px;
  width: calc(100% + 3rem);
  height: 2px;
  background: #E5E7EB;
  z-index: 1;
}

/* RTL adjustment for connector */
html[dir='rtl'] .step-item::after {
  right: 50%;
  left: auto;
}

/* Hide line for last item in row */
.step-item:nth-child(3n)::after {
  display: none;
}

@media (max-width: 992px) {
  .steps-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .step-item:nth-child(3n)::after {
    display: block;
  }

  .step-item:nth-child(2n)::after {
    display: none;
  }
}

@media (max-width: 650px) {
  .steps-container {
    grid-template-columns: 1fr;
  }

  .step-item::after,
  .step-item:nth-child(n)::after {
    display: none !important;
  }
}

.step-item h3 {
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-dark);
}

.step-item p {
  line-height: 1.7;
  font-size: 0.95rem;
}

/* --- Components: Testimonials --- */
.testimonial-card {
  position: relative;
}

.testimonial-text {
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
}

.student-info h4 {
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.student-info span {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* --- Components: Pricing Preview --- */
.pricing-cta-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: white;
  padding: 3rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
  gap: 2rem;
}

.pricing-cta-wrapper h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* --- Components: Final CTA --- */
.cta-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 5rem 0;
  text-align: center;

}

.cta-section h2 {
  margin-bottom: 1rem;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

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

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

/* Responsive Specifics */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
}

/* --- Flash Giveaway Custom Modals --- */
.flash-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.flash-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.flash-modal-card {
  background: white;
  width: 90%;
  max-width: 400px;
  border-radius: 32px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  transform: scale(0.8) translateY(20px);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  direction: rtl;
}

.flash-modal-overlay.open .flash-modal-card {
  transform: scale(1) translateY(0);
}

.flash-modal-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  display: block;
}

.flash-modal-title {
  font-size: 1.8rem;
  font-weight: 900;
  color: #1e293b;
  margin-bottom: 0.5rem;
  font-family: 'Cairo', sans-serif;
}

.flash-modal-subtitle {
  font-size: 1rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 2rem;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
}

.flash-modal-btn {
  background: #0f172a;
  color: white;
  border: none;
  padding: 12px 40px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  font-family: inherit;
}

.flash-modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.2);
}


/* --- Page Header (Premium Global Class) --- */
.page-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 6rem 0 3rem 0;
  text-align: center;
  border-radius: 0 0 2rem 2rem;
  margin-bottom: 3rem;
  position: relative;
}

.page-header h1 {
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 900;
  margin-bottom: 1rem;
  color: white;
}

.page-header p {
  font-size: 1.1rem;
  opacity: 0.95;
  color: rgba(255, 255, 255, 0.9);
}

.page-header .container {
  position: relative;
  z-index: 2;
}

/* --- About: Split Layout --- */
.split-layout {
  display: flex;
  align-items: center;
  gap: 4rem;
}

.split-content {
  flex: 1;
}

.text-large {
  font-size: 1.15rem;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
}

.split-image {
  flex: 1;
  display: flex;
  justify-content: center;
}

.image-placeholder {
  width: 100%;
  max-width: 400px;
  height: 300px;
  background-color: #E2E8F0;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: #CBD5E1;
}

@media (max-width: 768px) {
  .split-layout {
    flex-direction: column;
  }
}

/* --- About: Mission Cards --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.mission-card {
  padding: 3rem;
  border-left: 5px solid var(--primary-color);
}

.icon-box-sm {
  width: 50px;
  height: 50px;
  background-color: rgba(0, 137, 123, 0.1);
  color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

/* --- About: Values --- */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.value-item {
  text-align: center;
  padding: 2rem;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.value-item:hover {
  border-color: var(--primary-color);
  background-color: var(--bg-light);
}

.value-item i {
  font-size: 2.5rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.value-item h4 {
  font-size: 1.2rem;
  margin: 0;
}


/* --- Pricing Cards --- */
.pricing-card {
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
}

.pricing-card.featured {
  border: 2px solid var(--primary-color);
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

.pricing-card .badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--secondary-color);
  color: white;
  padding: 0.25rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
}

.card-header h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.card-header p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.price {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-dark);
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.25rem;
}

.price .currency {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
}

.price .period {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-light);
}

.pricing-features {
  text-align: right;
  /* RTL list */
  margin-bottom: 2rem;
  flex: 1;
  /* Pushes button to bottom */
}

.pricing-features li {
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.pricing-features li i {
  color: var(--primary-color);
  margin-left: 0.75rem;
  width: 20px;
  text-align: center;
}

.pricing-features li.disabled {
  color: #9CA3AF;
  text-decoration: line-through;
}

.pricing-features li.disabled i {
  color: #D1D5DB;
}

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

/* --- FAQ --- */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.faq-item {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid #E5E7EB;
}

.faq-item h4 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--primary-dark);
}


/* --- Contact Page --- */
.contact-grid {
  align-items: flex-start;
}

.info-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.info-item i {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-left: 1rem;
  width: 30px;
  text-align: center;
  margin-top: 5px;
}

.info-item h4 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  color: var(--text-dark);
}

.info-item p {
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  transition: var(--transition);
}

.social-links a:hover {
  background-color: var(--primary-color);
  color: white;
}

/* --- Components: Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 90%;
  max-width: 400px;
  animation: slideDown 0.4s ease forwards;
}

.toast {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 1rem;
  border-right: 5px solid #ccc;
}

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

.toast.success i {
  color: var(--primary-color);
}

.toast.error {
  border-right-color: #EF4444;
}

.toast.error i {
  color: #EF4444;
}

.toast-message {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* --- Components: Inline Errors --- */
.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-control.input-error {
  border-color: #EF4444 !important;
  background-color: #FEF2F2;
}

.form-control.input-error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.error-message {
  color: #EF4444;
  font-size: 0.85rem;
  margin-top: 0.4rem;
  display: block;
  animation: fadeIn 0.3s ease;
}

.social-links a:hover {
  background-color: var(--primary-color);
  color: white;
}

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

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

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #D1D5DB;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  resize: none;
}

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

.mb-4 {
  margin-bottom: 1.5rem;
}

.mt-4 {
  margin-top: 1.5rem;
}


/* --- Typography Updates (Mobile Friendly) --- */
@media (max-width: 768px) {
  html {
    font-size: 14px;
    /* Slightly smaller base font for mobile */
  }

  .hero-title {
    font-size: 2rem;
    /* reduced from 3.5rem/2.5rem */
    line-height: 1.3;
    padding: 0 1rem;
  }

  .hero-subtitle {
    font-size: 1rem;
    padding: 0 1.5rem;
  }

  .section-title {
    font-size: 1.75rem;
  }
}

/* Ensure CTA buttons are not too wide on mobile */
@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
    width: 100%;
    padding: 0 2rem;
  }

  .btn-lg {
    width: 100%;
  }
}

/* --- Exam Images --- */
.question-img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  display: block;
  border: 1px solid #e2e8f0;
  cursor: zoom-in;
}

.option-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.choice-img {
  max-width: 120px;
  max-height: 120px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  object-fit: contain;
  background: white;
  padding: 2px;
  cursor: zoom-in;
}

.review-question .choice-img {
  max-width: 100px;
  max-height: 100px;
}

/* App-Like Enhancements (Part 2) */

/* Prevent iOS zoom on input focus */
@media (max-width: 768px) {

  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ========================================
   App-Like Enhancements (Part 3)
   Animations & Polish
   ======================================== */

/* Page Enter Animation */
@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body {
  animation: pageEnter 0.4s ease-out;
}

/* Enhanced Card Hover */
.card:not(.card-admin):hover,
.subject-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* Ripple Effect on Buttons */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

/* Bottom Nav Active Indicator */
.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 0 0 3px 3px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Stagger Animation for Grid Items */
.grid-3>*,
.stats-grid>* {
  animation: fadeInUp 0.5s ease-out backwards;
}

.grid-3>*:nth-child(1),
.stats-grid>*:nth-child(1) {
  animation-delay: 0.1s;
}

.grid-3>*:nth-child(2),
.stats-grid>*:nth-child(2) {
  animation-delay: 0.2s;
}

.grid-3>*:nth-child(3),
.stats-grid>*:nth-child(3) {
  animation-delay: 0.3s;
}

.grid-3>*:nth-child(4),
.stats-grid>*:nth-child(4) {
  animation-delay: 0.4s;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Focus Styles for Accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* Mobile Performance Optimizations */
@media (max-width: 768px) {

  .card:hover,
  .subject-card:hover {
    transform: translateY(-4px);
  }
}

/* --- PWA Standalone Styles --- */
@media (display-mode: standalone) {

  /* Hide navigation menu and footer on Login and Register pages in the App */
  body:has(#loginForm) .navbar .menu-toggle,
  body:has(#loginForm) .navbar .nav-links,
  body:has(#loginForm) .footer,
  body:has(#registerForm) .navbar .menu-toggle,
  body:has(#registerForm) .navbar .nav-links,
  body:has(#registerForm) .footer {
    display: none !important;
  }

  /* Adjust padding if header is removed */
  body:has(#loginForm) .page-header,
  body:has(#registerForm) .page-header {
    padding-top: 2rem;
  }

  /* App-Like Enhancements (PWA Only) */
  * {
    -webkit-tap-highlight-color: transparent;
  }

  /* Hide Scrollbar but allow scrolling */
  ::-webkit-scrollbar {
    display: none;
  }

  /* Prevent text selection on UI elements */
  a,
  button,
  .btn,
  .navbar,
  .footer,
  .card-header,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  .stat-label,
  .section-title,
  .section-subtitle {
    user-select: none;
    -webkit-user-select: none;
  }

  /* Active State (Touch Feedback) */
  a:active,
  button:active,
  .btn:active,
  .card:active,
  .subject-card:active {
    transform: scale(0.98);
    opacity: 0.9;
  }
}

/* Leaderboard Button */
.btn-leaderboard {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  padding: 1rem 2rem;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(3, 169, 244, 0.3);
  color: white !important;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 700;
  border: none;
}

.btn-leaderboard:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 10px 25px rgba(3, 169, 244, 0.5);
  filter: brightness(1.1);
}

.btn-leaderboard i {
  font-size: 1.2rem;
}

/* Landing Page Styles (Index) */
.hero {
  background: linear-gradient(135deg, #03A9F4 0%, #0288D1 100%);
  padding: 8rem 0 6rem;
  position: relative;
  overflow: hidden;
  color: white;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.05" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,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>');
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-title .highlight {
  color: #FFC107;
  position: relative;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  margin-bottom: 2.5rem;
  opacity: 0.95;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-cta .btn {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  border-radius: 50px;
}

.hero-cta .btn-primary {
  background: white;
  color: var(--primary-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero-cta .btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.hero-cta .btn-outline {
  border: 2px solid white;
  color: white;
  background: transparent;
}

.hero-cta .btn-outline:hover {
  background: white;
  color: var(--primary-color);
}

/* Features Section */
.features {
  padding: 5rem 0;
}

.feature-card {
  text-align: center;
  padding: 2.5rem;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-10px);
}

.icon-box {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #03A9F4 0%, #0288D1 100%);
  color: white;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
  box-shadow: 0 10px 30px rgba(3, 169, 244, 0.3);
}

/* Stats Section */
.stats-section {
  background: linear-gradient(135deg, #03A9F4 0%, #0288D1 100%);
  padding: 4rem 0;
  color: white;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  text-align: center;
}

.stat-item h3 {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.stat-item p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.coming-soon-badge {
  background: #FFC107;
  color: #000;
  padding: 0.2rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: inline-block;
}

/* Pomodoro Widget */
.pomodoro-box {
  text-align: center;
  padding: 2rem;
  background: #fff5f5;
  border: 2px dashed #feb2b2;
  border-radius: 20px;
  margin-bottom: 2rem;
}

.timer-display {
  font-size: 3.5rem;
  font-weight: 900;
  color: #e53e3e;
  font-family: monospace;
  margin: 10px 0;
}

/* ==========================================
   Unified Popup Theme (SweetAlert2 & Custom)
   ========================================== */
:root {
  --popup-radius: 20px;
  --popup-padding: 2rem;
  --popup-backdrop: rgba(15, 23, 42, 0.4);
  --popup-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --popup-bg: #FFFFFF;
}

/* 1. SweetAlert2 Overrides */
div:where(.swal2-container).swal2-center>.swal2-popup {
  border-radius: var(--popup-radius);
  padding: var(--popup-padding);
  box-shadow: var(--popup-shadow);
  background: var(--popup-bg);
}

div:where(.swal2-container).swal2-backdrop-show,
div:where(.swal2-container).swal2-noanimation {
  background: var(--popup-backdrop) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

div:where(.swal2-container) .swal2-title {
  font-family: 'Cairo', sans-serif !important;
  color: var(--text-main);
  font-size: 1.5rem;
  font-weight: 800;
}

div:where(.swal2-container) .swal2-html-container {
  font-family: 'Cairo', sans-serif !important;
  color: #64748b;
  font-size: 1.1rem;
}

div:where(.swal2-container) .swal2-actions {
  gap: 12px;
  margin-top: 1.5rem;
}

div:where(.swal2-container) button.swal2-styled {
  border-radius: 12px !important;
  font-weight: 700 !important;
  padding: 12px 24px !important;
  font-family: 'Cairo', sans-serif !important;
  box-shadow: none !important;
  transition: all 0.2s ease;
}

div:where(.swal2-container) button.swal2-styled:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* 2. Custom Modals Alignment (Used in Todo/Admin) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--popup-backdrop);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

.modal-box,
.modal-container {
  background: var(--popup-bg);
  padding: var(--popup-padding);
  border-radius: var(--popup-radius);
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--popup-shadow);
  transform: scale(0.9);
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalPop {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Modal Inner Structure (Admin/Todo Extended) */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main, #1e293b);
  line-height: 1.2;
}

.modal-body {
  margin-bottom: 2rem;
  text-align: right;
}

.modal-footer,
.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-modal {
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal.confirm {
  background: var(--primary-color, #03A9F4);
  color: white;
}

.btn-modal.confirm:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
}

.btn-modal.cancel {
  background: #f1f5f9;
  color: #64748b;
}

.btn-modal.cancel:hover {
  background: #e2e8f0;
}

/* --- Skeleton Loading (Premium Feel) --- */
.skeleton {
  background-color: #e2e8f0;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.4) 50%,
      rgba(255, 255, 255, 0) 100%);
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  0% {
    transform: translateX(100%);
  }

  100% {
    transform: translateX(-100%);
  }
}

.skeleton-chapter {
  height: 80px;
  width: 100%;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
}

.skeleton-lesson {
  height: 40px;
  width: 90%;
  margin: 10px auto;
}

.skeleton-text {
  height: 12px;
  width: 100%;
  margin-bottom: 8px;
}

.skeleton-btn {
  height: 35px;
  width: 100px;
  border-radius: 20px;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* --- PWA Install Banner (Premium) --- */
.pwa-banner {
  position: fixed;
  bottom: 80px;
  /* Above bottom nav */
  left: 50%;
  transform: translateX(-50%) translateY(200px);
  width: calc(100% - 2rem);
  max-width: 500px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px -5px rgba(3, 169, 244, 0.3);
  z-index: 2000;
  border: 1px solid rgba(3, 169, 244, 0.1);
  animation: banner-enter 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 2s;
  /* Give user some time before showing */
}

@keyframes banner-enter {
  to {
    transform: translateX(-50%) translateY(0);
  }
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.pwa-banner-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  padding: 5px;
  flex-shrink: 0;
}

.pwa-banner-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pwa-banner-text {
  flex: 1;
  min-width: 0;
}

.pwa-banner-text h3 {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 2px;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-banner-text p {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.3;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: 50px;
}

.btn-close-banner {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 5px;
  font-size: 1rem;
  transition: var(--transition);
}

.btn-close-banner:hover {
  color: #EF4444;
}

/* Adjust for larger screens (not above bottom nav) */
@media (min-width: 866px) {
  .pwa-banner {
    bottom: 2rem;
  }
}

/* Modal Styles for PWA Instructions */
.modal {
  display: none;
  position: fixed;
  z-index: 3000;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  padding-top: 80px;
}

.modal-content.pwa-modal {
  background-color: var(--bg-white, #fff);
  margin: auto;
  padding: 2rem;
  border-radius: var(--radius-lg, 20px);
  width: 90%;
  max-width: 480px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: modalSlide 0.3s ease-out;
  direction: rtl;
  text-align: right;
}

@keyframes modalSlide {
  from {
    transform: translateY(-40px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close-modal {
  color: #aaa;
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

.close-modal:hover {
  color: var(--text-dark);
}

.pwa-modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.pwa-modal-header i {
  font-size: 2.5rem;
  color: var(--primary-color);
  display: block;
  margin-bottom: .5rem;
}

.pwa-modal-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: .25rem;
}

.pwa-modal-header p {
  font-size: 0.85rem;
  color: var(--text-light);
}

.pwa-step {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.75rem;
  background: var(--bg-light, #f8fafc);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md, 12px);
}

.pwa-step i {
  font-size: 1.1rem;
  color: var(--primary-color);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.pwa-step p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* --- Profile Stats Mobile Alignment --- */
@media (max-width: 768px) {
  #profileStatsGrid {
    justify-content: center !important;
  }

  .stat-card {
    align-items: center !important;
    text-align: center !important;
  }
}

/* --- Announcement Toast Notifications --- */
#announcements-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
  width: calc(100% - 40px);
}

.announcement-toast {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-right: 4px solid var(--primary-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  animation: slideInRight 0.4s ease-out;
  direction: rtl;
  text-align: right;
}

.announcement-toast strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.announcement-toast p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin: 0;
  line-height: 1.6;
}

.announcement-toast button {
  position: absolute;
  top: 10px;
  left: 10px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.announcement-toast button:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: #EF4444;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  #announcements-container {
    top: 70px;
    right: 10px;
    max-width: calc(100% - 20px);
    width: calc(100% - 20px);
  }

  .announcement-toast {
    padding: 1rem;
  }

  .announcement-toast strong {
    font-size: 1rem;
  }

  .announcement-toast p {
    font-size: 0.9rem;
  }
}

/* Announcement Type Colors */
.announcement-toast.announcement-info {
  border-right-color: #03A9F4;
  background: linear-gradient(135deg, #e3f2fd 0%, #f8fafc 100%);
}

.announcement-toast.announcement-info strong {
  color: #0277BD;
}

.announcement-toast.announcement-warning {
  border-right-color: #FF9800;
  background: linear-gradient(135deg, #fff3e0 0%, #fffbf5 100%);
}

.announcement-toast.announcement-warning strong {
  color: #E65100;
}

.announcement-toast.announcement-danger {
  border-right-color: #F44336;
  background: linear-gradient(135deg, #ffebee 0%, #fff5f5 100%);
}

.announcement-toast.announcement-danger strong {
  color: #C62828;
}

.announcement-toast.announcement-success {
  border-right-color: #4CAF50;
  background: linear-gradient(135deg, #e8f5e9 0%, #f5fdf5 100%);
}

.announcement-toast.announcement-success strong {
  color: #2E7D32;
}

/* --- Senior UI Final Polish (v402.76) --- */
.stat-card {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

/* Balanced Stat Labels */
.stat-value-container {
  position: relative;
  display: inline-block;
  margin: 10px 0;
}

.stat-side-label {
  position: absolute;
  font-size: 0.65rem;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.95;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* Circular Letter for Grade Card */
.stat-side-label.label-side-tr {
  top: -10px;
  right: -5px;
  /* Shifted from -35px for better alignment */
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: white;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-weight: 900;
  z-index: 5;
}

.label-side-tl {
  top: -8px;
  left: -5px;
  /* Shifted from -55px for better alignment */
  direction: rtl;
  color: #64748b;
  font-family: inherit;
  font-weight: 700;
}

/* Subject Card Badges - Senior Dual Circle Design */
.subject-badges-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.subject-badge-tag {
  position: absolute;
  top: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.4s ease;
}

.badge-tag-tr {
  right: 14px;
}

.badge-tag-tl {
  left: 14px;
}

.badge-circle {
  width: 34px;
  /* Perfectly sized for Grade & Letter */
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 950;
  background: white;
  border: 1.5px solid #eef2f6;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
  color: #1e293b;
}

.badge-circle.accent {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #03A9F4;
  font-size: 0.7rem;
}

.badge-circle.grade-fill {
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Solving Count Badge */
.badge-tag-tl .badge-circle {
  min-width: 34px;
  width: auto;
  padding: 0 12px;
  border-radius: 17px;
}

/* Cleanup Legacy Bloat - Ensure 100% removal */
.subject-badge-tag i,
.subject-icon-badge,
.accuracy-grade-badge,
.grade-badge-premium,
.subject-badge-tag span.tag-text-main,
.subject-badge-tag span.tag-text-sub,
.subject-badge-tag span.tag-text {
  display: none !important;
}

/* Subtle Placeholder Sway */
@keyframes idle-sway {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-3px) rotate(3deg);
  }
}

.idle-sway-icon {
  font-size: 1.4rem;
  color: #03A9F4;
  opacity: 0.6;
  animation: idle-sway 4s infinite ease-in-out;
}

/* --- Components: Testimonials (v403.12) --- */
.testimonials {
  background: linear-gradient(to bottom, #f8fafc, #ffffff);
  padding: 6rem 0;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.testimonial-card {
  background: white;
  padding: 1.75rem;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 5rem;
  color: var(--primary-color);
  opacity: 0.1;
  font-family: serif;
  line-height: 1;
}

.stars {
  color: #fbbf24;
  margin-bottom: 1rem;
  display: flex;
  gap: 4px;
}

.stars .not {
  color: #ccc;
}

.testimonial-content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
  font-weight: 500;
  flex-grow: 1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.03);
}

.author-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--primary-color);
}

.author-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
  direction: ltr;
}

.author-info p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 0;
}

/* --- Version Number for Standalone/Mobile App --- */
.app-version-standalone {
  display: none;
  text-align: center;
  padding: 1.5rem 0;
  /* Space for bottom nav */
  opacity: 0.4;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dark);
}

@media (display-mode: standalone) {
  .footer {
    display: none !important;
  }

  .app-version-standalone {
    display: block;
  }
}