/* نظام الألوان المعدل */
:root {
    /* الألوان الأساسية */
    --primary: #0069a7;
    --primary-light: #3b9bdc;
    --primary-dark: #00548f;
    --primary-transparent: rgba(0, 105, 167, 0.1);
    
    /* الألوان الثانوية */
    --secondary: #02c2f9;
    --secondary-light: #34d3ff;
    --secondary-dark: #02a9d9;
    
    /* الألوان المحايدة */
    --dark: #1e293b;
    --darker: #0f172a;
    --light: #f8fafc;
    --lighter: #ffffff;
    --gray: #94a3b8;
    --gray-light: #e2e8f0;
    
    /* ألوان النص */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #f8fafc;
    
    /* الظلال */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.2);
    
    /* الزوايا */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* الانتقالات */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

/* إعادة تعيين العناصر */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body.dark {
    background-color: var(--darker);
    color: var(--text-light);
}

/* شريط التقدم العام */
.global-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--secondary);
    z-index: 9999;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    width: 100%;
}

/* خلفية الجسيمات */
.particles-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.7;
}

.dark .particles-background {
    opacity: 0.5;
}

/* الهيدر المعدل */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    position: relative;
    z-index: 10;
    backdrop-filter: blur(10px);
    background-color: rgba(248, 250, 252, 0.85);
}

.dark .header {
    background-color: rgba(15, 23, 42, 0.85);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-animation {
    display: flex;
    align-items: center;
    position: relative;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
}

.logo-jaber {
    position: relative;
    z-index: 1;
}

.logo-dev {
    color: var(--secondary);
    margin-left: 0.1rem;
}

.logo-dot {
    position: absolute;
    right: -0.4rem;
    bottom: 0.2rem;
    width: 0.4rem;
    height: 0.4rem;
    background-color: var(--secondary);
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.theme-toggle, .language-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    width: 2.2rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.dark .theme-toggle, .dark .language-toggle {
    color: var(--text-light);
}

.theme-toggle:hover, .language-toggle:hover {
    background-color: var(--primary-transparent);
    color: var(--primary);
}

.language-toggle {
    padding: 0 0.5rem;
    width: auto;
    gap: 0.3rem;
}

.language-text {
    font-size: 0.7rem;
    font-weight: 700;
}

/* تأثير التموج */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect:after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 1%, transparent 1%) center/15000%;
    opacity: 0;
    transition: opacity 0.5s, background-size 0.5s;
}

.ripple-effect:active:after {
    background-size: 100%;
    opacity: 1;
    transition: 0s;
}

/* القسم الرئيسي المعدل */
.main-content {
    min-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    padding: 0 5%;
}

.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .hero-section {
        flex-direction: row;
        min-height: 80vh;
    }
}

.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 600px;
}

.launch-badge {
    background-color: var(--primary-transparent);
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.dark .launch-badge {
    background-color: rgba(0, 105, 167, 0.2);
}

.hero-title {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.title-line {
    display: block;
}

.highlight {
    color: var(--primary);
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 0.2rem;
    left: 0;
    width: 100%;
    height: 0.4rem;
    background-color: rgba(0, 105, 167, 0.2);
    z-index: -1;
    border-radius: var(--radius-full);
}

.typing-text {
    display: inline-block;
    min-width: 120px;
}

.typing-text::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 500px;
}

.dark .hero-subtitle {
    color: var(--gray);
}

/* مؤشر التمرير */
.scroll-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    color: var(--primary);
    font-size: 1.2rem;
}

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

/* العداد التنازلي المعدل */
.countdown-container {
    width: 100%;
    margin: 1.5rem 0;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    max-width: 500px;
}

.countdown-item {
    background-color: var(--lighter);
    border-radius: var(--radius-md);
    padding: 0.8rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.dark .countdown-item {
    background-color: rgba(30, 41, 59, 0.5);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.countdown-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.countdown-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.2rem;
}

.countdown-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.dark .countdown-label {
    color: var(--gray);
}

/* صورة الأجهزة المعدلة */
.hero-image {
    flex: 1;
    position: relative;
    height: 250px;
    width: 100%;
    max-width: 500px;
}

.floating-devices {
    position: relative;
    height: 100%;
    width: 100%;
}

.device {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(var(--shadow-lg));
    animation: float 6s ease-in-out infinite;
}

.device::after {
    content: "";
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
    transform: scaleY(-1) rotateX(180deg);
    opacity: 0.5;
}

.laptop {
    width: 350px;
    height: 220px;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0s;
}

.tablet {
    width: 150px;
    height: 220px;
    top: 40px;
    left: 0;
    animation-delay: 1s;
}

.phone {
    width: 100px;
    height: 180px;
    bottom: 0;
    right: 0;
    animation-delay: 2s;
}

/* تحميل متقطع للصور */
.lazy-image {
    background-color: var(--gray-light);
    background-image: none !important;
}

.lazy-image.loaded {
    background-image: inherit !important;
}

/* قسم الاشتراك المعدل بالكامل */
.cta-section {
    padding: 3rem 0;
    display: flex;
    justify-content: center;
}

.cta-content {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.cta-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.notify-form {
    margin: 1.5rem 0;
}

.input-group {
    position: relative;
    display: flex;
    width: 100%;
    transition: var(--transition);
}

[dir="ltr"] .input-group {
    flex-direction: row;
}

[dir="rtl"] .input-group {
    flex-direction: row-reverse;
}

.input-group input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--gray);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    transition: var(--transition);
    background-color: transparent;
    color: var(--text-primary);
    width: 100%;
}

[dir="rtl"] .input-group input {
    padding-right: 3.5rem;
    text-align: right;
}

[dir="ltr"] .input-group input {
    padding-left: 3.5rem;
    text-align: left;
}

.input-group.focused input {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 120, 188, 0.15);
}

.input-group label {
    position: absolute;
    top: 0.8rem;
    transition: var(--transition);
    pointer-events: none;
    color: var(--text-secondary);
}

[dir="rtl"] .input-group label {
    right: 3.5rem;
}

[dir="ltr"] .input-group label {
    left: 3.5rem;
}

.notify-button {
    position: absolute;
    top: 0.2rem;
    bottom: 0.2rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    padding: 0 1.2rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
    min-width: fit-content;
}

[dir="rtl"] .notify-button {
    left: 0.2rem;
    right: auto;
}

[dir="ltr"] .notify-button {
    right: 0.2rem;
    left: auto;
}

.input-group.focused .notify-button {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.notify-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.notify-button:active {
    transform: translateY(0) scale(0.98);
}

/* تأثيرات التركيز المعدلة */
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    transform: translateY(-1.5rem) scale(0.85);
    background-color: var(--light);
    padding: 0 0.4rem;
    color: var(--primary);
}

[dir="rtl"] .input-group input:focus + label,
[dir="rtl"] .input-group input:not(:placeholder-shown) + label {
    right: 2.5rem;
}

[dir="ltr"] .input-group input:focus + label,
[dir="ltr"] .input-group input:not(:placeholder-shown) + label {
    left: 2.5rem;
}

.dark .input-group input:focus + label,
.dark .input-group input:not(:placeholder-shown) + label {
    background-color: var(--darker);
}

/* روابط التواصل المعدلة */
.social-links {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.social-link {
    width: 2.2rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-transparent);
    color: var(--primary);
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* نافذة الاشتراك العائمة */
.smart-popup {
    position: fixed;
    bottom: 20px;
    right: -400px;
    width: 350px;
    background-color: var(--lighter);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 100;
    transition: right 0.5s ease;
    padding: 1.5rem;
}

.dark .smart-popup {
    background-color: var(--dark);
}

.smart-popup.active {
    right: 20px;
}

.popup-content {
    position: relative;
}

.popup-content h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.popup-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.dark .popup-content p {
    color: var(--gray);
}

.close-popup {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.close-popup:hover {
    background-color: var(--primary-dark);
    transform: rotate(90deg);
}

/* الفوتر المعدل */
.footer {
    padding: 1rem 5%;
    background-color: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(5px);
    text-align: center;
}

.dark .footer {
    background-color: rgba(15, 23, 42, 0.9);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dark .copyright {
    color: var(--gray);
}

.contact-email {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.contact-email:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.privacy-link {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-decoration: none;
    transition: var(--transition);
}

.privacy-link:hover {
    color: var(--primary);
}

/* الأنيميشن المعدلة */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* أنماط الإشعارات */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.9rem;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-success {
    background-color: #10b981;
}

.notification-error {
    background-color: #ef4444;
}

/* ===== تحسينات Responsive الشاملة ===== */
@media (max-width: 1024px) {
    /* تحسينات للتابلت */
    .hero-section {
      flex-direction: column;
      padding-top: 1.5rem;
    }
    
    .hero-content, .hero-image {
      max-width: 100% !important;
      text-align: center;
      align-items: center !important;
    }
    
    .countdown-grid {
      margin: 0 auto;
    }
  }
  
  @media (max-width: 768px) {
    /* تحسينات الهيدر */
    .header {
      flex-direction: column;
      align-items: center;
      padding: 0.8rem 1rem;
    }
    
    .logo-container {
      margin-bottom: 0.5rem;
      width: 100%;
      text-align: center;
    }
    
    .header-actions {
      width: 100%;
      justify-content: center;
      gap: 1rem;
    }
    
    /* تحسينات المحتوى الرئيسي */
    .hero-title {
      font-size: 1.8rem !important;
      line-height: 1.3;
    }
    
    .hero-subtitle {
      font-size: 0.95rem;
      padding: 0 1rem;
    }
    
    /* تحسينات الأجهزة العائمة */
    .floating-devices {
      height: 200px !important;
      margin-top: 1.5rem;
    }
    
    .laptop {
      width: 280px !important;
      height: 170px !important;
    }
    
    .tablet {
      width: 130px !important;
      height: 190px !important;
      top: 30px !important;
    }
    
    .phone {
      width: 90px !important;
      height: 160px !important;
    }
    
    /* تحسينات النافذة العائمة */
    .smart-popup {
      width: 300px;
    }
  }
  
  @media (max-width: 600px) {
    /* تحسينات العداد التنازلي */
    .countdown-grid {
      grid-template-columns: repeat(2, 1fr) !important;
      gap: 0.8rem;
      max-width: 300px !important;
    }
    
    .countdown-item {
      padding: 0.8rem 0.5rem !important;
    }
    
    .countdown-number {
      font-size: 1.4rem !important;
    }
    
    .countdown-label {
      font-size: 0.7rem !important;
    }
  }
  
  @media (max-width: 480px) {
    /* تحسينات عامة للهواتف */
    html {
      font-size: 15px;
    }
    
    body {
      overflow-x: hidden;
    }
    
    /* تحسينات الهيدر */
    .header {
      padding: 0.6rem 1rem;
    }
    
    .logo-animation {
      font-size: 1.2rem !important;
    }
    
    /* تحسينات المحتوى الرئيسي */
    .hero-title {
      font-size: 1.6rem !important;
    }
    
    .hero-subtitle {
      font-size: 0.9rem;
      padding: 0 0.5rem;
    }
    
    /* تحسينات نموذج الاشتراك */
    .input-group {
      flex-direction: column;
      gap: 0.5rem;
    }
    
    .input-group input {
      padding: 1rem !important;
      text-align: center !important;
      width: 100% !important;
    }
    
    .notify-button {
      position: relative !important;
      width: 100% !important;
      margin-top: 0.5rem !important;
      padding: 1rem !important;
      justify-content: center;
    }
    
    .input-group label {
      left: 50% !important;
      right: auto !important;
      transform: translateX(-50%) !important;
      text-align: center;
      width: 100%;
    }
    
    .input-group input:focus + label,
    .input-group input:not(:placeholder-shown) + label {
      transform: translateY(-1.5rem) translateX(-50%) scale(0.85) !important;
    }
    
    /* تحسينات الأجهزة العائمة */
    .floating-devices {
      height: 180px !important;
    }
    
    .laptop {
      width: 260px !important;
      height: 160px !important;
    }
    
    .tablet, .phone {
      display: none;
    }
    
    /* تحسينات الفوتر */
    .footer {
      padding: 1rem 0.5rem !important;
    }
    
    .copyright, .contact-email {
      font-size: 0.75rem !important;
    }
    
    /* تحسينات الإشعارات */
    .notification {
      right: 10px;
      left: 10px;
      max-width: calc(100% - 20px);
    }
    
    /* تحسينات النافذة العائمة */
    .smart-popup {
      width: calc(100% - 40px);
      right: -100%;
    }
    
    .smart-popup.active {
      right: 20px;
    }
  }
  
  @media (max-width: 360px) {
    /* تحسينات للشاشات الصغيرة جدًا */
    html {
      font-size: 14px;
    }
    
    .hero-title {
      font-size: 1.4rem !important;
    }
    
    .countdown-number {
      font-size: 1.3rem !important;
    }
    
    .countdown-label {
      font-size: 0.65rem !important;
    }
  }
  
  @media (max-height: 500px) and (orientation: landscape) {
    /* تحسينات للوضع الأفقي */
    .header {
      padding: 0.5rem 1rem !important;
    }
    
    .hero-section {
      min-height: 50vh !important;
      padding-top: 0.5rem !important;
    }
    
    .hero-content {
      max-width: 55% !important;
    }
    
    .hero-image {
      max-width: 45% !important;
      height: 160px !important;
    }
    
    .laptop {
      width: 220px !important;
      height: 140px !important;
    }
    
    .scroll-hint {
      display: none;
    }
  }