@import url("../variables.css");

/* ====== متغيرات إضافية ====== */
:root {
  --gradient-primary: linear-gradient(135deg, #8A2BE2 0%, #470d88 100%);
  --gradient-light: linear-gradient(135deg, rgba(138, 43, 226, 0.1) 0%, rgba(71, 13, 136, 0.05) 100%);
  --shadow-lg: 0 20px 40px rgba(138, 43, 226, 0.15);
  --shadow-xl: 0 25px 50px rgba(138, 43, 226, 0.2);
}

/* ====== قسم البطل المعدل ====== */
.hm-section {
  font-family: var(--font-family);
  position: relative;
  overflow: hidden;
  padding: 100px 80px;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background-image: url("../images/kids/hero1.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  isolation: isolate;
}

.hm-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.85) 50%,
    rgba(138, 43, 226, 0.1) 100%);
  z-index: -1;
  backdrop-filter: blur(2px);
}

.hm-section::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: var(--gradient-light);
  transform: rotate(45deg);
  z-index: -1;
  opacity: 0.5;
}

html[dir="rtl"] .hm-section {
  background-image: url("../images/kids/hero-pc-ar.jpg");
}

@media (max-width: 992px) {
  .hm-section {
    padding: 80px 40px;
    background-attachment: scroll;
  }
}

@media (max-width: 768px) {
  .hm-section {
    padding: 60px 24px;
    background-image: url("../images/kids/hero2.jpg");
  }
  
  html[dir="rtl"] .hm-section {
    background-image: url("../images/kids/hero2.jpg");
  }
}

/* ====== الحاوية الرئيسية ====== */
.hm-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 80px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  z-index: 1;
}

/* ====== العمود النصي ====== */
.hm-text-col {
  flex: 1;
  min-width: 280px;
  max-width: 650px;
  animation: slideInLeft 0.8s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

html[dir="rtl"] .hm-text-col {
  animation: slideInRight 0.8s ease-out;
}

/* ====== العنوان ====== */
.hm-title {
  font-size: clamp(2.5rem, 5vw, var(--fs-hero-title));
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 30px;
  position: relative;
  display: inline-block;
}

.hm-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 80px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
  animation: expandWidth 1s ease-out 0.5s forwards;
}

@keyframes expandWidth {
  to {
    width: 160px;
  }
}

html[dir="rtl"] .hm-title::after {
  left: auto;
  right: 0;
}

.hm-title-line {
  display: block;
  position: relative;
}

.hm-main-color {
  color: #470d88;
  position: relative;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hm-accent-color {
  color: #8A2BE2;
}

/* ====== الوصف ====== */
.hm-desc {
  font-size: clamp(1rem, 1.2vw, var(--fs-button));
  color: #4a5568;
  margin-bottom: 40px;
  line-height: 1.8;
  padding: 20px 0;
  border-left: 4px solid #8A2BE2;
  padding-left: 20px;
  background: linear-gradient(90deg, 
    rgba(138, 43, 226, 0.05) 0%, 
    transparent 100%);
  border-radius: 0 8px 8px 0;
}

html[dir="rtl"] .hm-desc {
  border-left: none;
  border-right: 4px solid #8A2BE2;
  padding-left: 0;
  padding-right: 20px;
  background: linear-gradient(270deg, 
    rgba(138, 43, 226, 0.05) 0%, 
    transparent 100%);
  border-radius: 8px 0 0 8px;
}

/* ====== الأزرار ====== */
.hm-btn-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.hm-btn {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: var(--fs-button);
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  z-index: 1;
  min-width: 180px;
  justify-content: center;
}

.hm-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.6s ease;
  z-index: -1;
}

.hm-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.hm-btn:hover::before {
  left: 100%;
}

.hm-btn-arrow {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.hm-btn:hover .hm-btn-arrow {
  transform: translateX(4px);
}

html[dir="rtl"] .hm-btn:hover .hm-btn-arrow {
  transform: translateX(-4px);
}

/* ====== زر ثانوي ====== */
.hm-btn-secondary {
  background: white;
  color: #470d88;
  border: 2px solid #8A2BE2;
  box-shadow: 0 4px 15px rgba(138, 43, 226, 0.1);
}

.hm-btn-secondary:hover {
  background: var(--gradient-light);
}

/* ====== العناصر التفاعلية ====== */
.hm-features {
  display: flex;
  gap: 30px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.hm-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.hm-feature:hover {
  transform: translateY(-5px);
}

.hm-feature-icon {
  width: 24px;
  height: 24px;
  color: #8A2BE2;
}

.hm-feature-text {
  font-size: 0.9rem;
  color: #4a5568;
  font-weight: 500;
}

/* ====== النص العمودي ====== */
.hm-vertical-text {
  position: absolute;
  right: 40px;
  bottom: 50%;
  transform: translateY(50%) rotate(90deg);
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 2;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.hm-vertical-text:hover {
  opacity: 1;
}

.hm-mouse-icon {
  width: 16px;
  transform: rotate(-90deg);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: rotate(-90deg) translateY(0);
  }
  40% {
    transform: rotate(-90deg) translateY(-10px);
  }
  60% {
    transform: rotate(-90deg) translateY(-5px);
  }
}

.hm-vertical-text span {
  color: #470d88;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ====== RTL دعم ====== */
html[dir="rtl"] .hm-title {
  text-align: right;
}

html[dir="rtl"] .hm-vertical-text {
  right: auto;
  left: 40px;
  transform: translateY(50%) rotate(-90deg);
}

html[dir="rtl"] .hm-mouse-icon {
  transform: rotate(90deg);
}

/* ====== التجاوب ====== */
@media (max-width: 1200px) {
  .hm-container {
    gap: 60px;
  }
}

@media (max-width: 992px) {
  .hm-container {
    flex-direction: column;
    text-align: center;
    gap: 50px;
  }

  .hm-text-col {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hm-title::after {
    left: 50%;
    transform: translateX(-50%);
  }

  html[dir="rtl"] .hm-title::after {
    right: 50%;
    left: auto;
    transform: translateX(50%);
  }

  .hm-desc {
    border-left: none;
    padding-left: 0;
    background: none;
    border-radius: 8px;
    border-top: 4px solid #8A2BE2;
    border-bottom: 4px solid #8A2BE2;
    padding: 20px;
  }

  html[dir="rtl"] .hm-desc {
    border-right: none;
    padding-right: 0;
  }

  .hm-btn-wrapper {
    justify-content: center;
  }

  .hm-features {
    justify-content: center;
  }

  .hm-vertical-text {
    display: none;
  }
}

@media (max-width: 576px) {
  .hm-section {
    min-height: auto;
    padding: 60px 20px;
  }

  .hm-title {
    font-size: 2rem;
  }

  .hm-btn {
    width: 100%;
    max-width: 280px;
  }

  .hm-btn-wrapper {
    flex-direction: column;
    width: 100%;
  }

  .hm-features {
    flex-direction: column;
    width: 100%;
  }

  .hm-feature {
    width: 100%;
    justify-content: center;
  }
}

/* ====== تأثيرات التحميل ====== */
.hm-loading {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hm-loading:nth-child(1) { animation-delay: 0.1s; }
.hm-loading:nth-child(2) { animation-delay: 0.2s; }
.hm-loading:nth-child(3) { animation-delay: 0.3s; }
.hm-loading:nth-child(4) { animation-delay: 0.4s; }