/* ═══════════════════════════════════════
   Media Serve Platform — app.css
═══════════════════════════════════════ */
:root {
  --primary: #2563eb; --primary-dark: #1d4ed8; --primary-light: #eff6ff;
  --green: #16a34a; --red: #dc2626; --orange: #d97706; --purple: #7c3aed;
  --gray-50: #f8fafc; --gray-100: #f1f5f9; --gray-200: #e2e8f0;
  --gray-500: #64748b; --gray-700: #334155; --gray-900: #0f172a;
  --radius: 12px; --shadow: 0 1px 3px rgba(0,0,0,.1); --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1); --shadow-lg: 0 10px 25px rgba(0,0,0,.15);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Cairo', 'Segoe UI', sans-serif; background: #fff; color: var(--gray-900); line-height: 1.7; }
body.rtl { direction: rtl; font-family: 'Cairo', sans-serif; }
body.ltr { direction: ltr; font-family: 'Inter', sans-serif; }
a { text-decoration: none; color: var(--primary); }
img { max-width: 100%; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 24px; border-radius: 9px; font-weight: 700; font-size: 14px; border: none; transition: all .2s; cursor: pointer; text-decoration: none; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--primary, #2563eb); border: 2px solid var(--primary, #2563eb); }
.btn-ghost:hover { background: var(--primary, #2563eb); color: #fff; }
.btn-ghost-white { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.5); }
.btn-ghost-white:hover { background: rgba(255,255,255,.15); }
.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { background: #f0f9ff; }
.btn-danger { background: var(--red); color: #fff; border: none; padding: 6px 14px; border-radius: 6px; font-size: 12px; }
.btn-success { background: var(--green); color: #fff; border: none; padding: 6px 14px; border-radius: 6px; font-size: 12px; }
.btn-sm { padding: 7px 16px; font-size: 12px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-xl { padding: 16px 36px; font-size: 17px; border-radius: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn-arrow { display: inline-block; transition: transform .2s; }
.btn:hover .btn-arrow { transform: translateX(-4px); }
.rtl .btn:hover .btn-arrow { transform: translateX(4px); }

/* ── Form ── */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--gray-700); }
.form-input { width: 100%; padding: 11px 16px; border: 1.5px solid var(--gray-200); border-radius: 9px; font-size: 14px; background: #fff; transition: border-color .2s; }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.input-with-icon { position: relative; }
.input-with-icon .form-input { padding-left: 44px; }
.rtl .input-with-icon .form-input { padding-left: 16px; padding-right: 44px; }
.toggle-pass { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--gray-500); font-size: 16px; }
.rtl .toggle-pass { left: auto; right: 12px; }

/* ── Alerts ── */
.alert { padding: 12px 18px; border-radius: 9px; font-size: 13px; margin-bottom: 16px; }
.alert-success { background: #f0fdf4; color: var(--green); border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; }
.alert-info { background: var(--primary-light); color: var(--primary); border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: var(--orange); border: 1px solid #fde68a; }

/* ── Toast ── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1e293b; color: #fff; padding: 12px 24px; border-radius: 999px; font-size: 14px; z-index: 9999; box-shadow: var(--shadow-lg); transition: opacity .3s; }
.toast-success { background: #15803d; }
.toast-error { background: var(--red); }

/* ── Badge ── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-red { background: #fee2e2; color: var(--red); }
.badge-blue { background: #dbeafe; color: var(--primary); }
.badge-orange { background: #fef3c7; color: var(--orange); }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }
.badge-purple { background: #ede9fe; color: var(--purple); }

/* ═══ NAVBAR ═══ */
.site-header { position: sticky; top: 0; z-index: 999; background: rgba(255,255,255,.97); backdrop-filter: blur(12px); border-bottom: 1px solid var(--gray-200); }
.navbar { max-width: 1160px; margin: 0 auto; padding: 0 20px; height: 68px; display: flex; align-items: center; justify-content: space-between; }
.navbar-logo { font-size: 20px; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.logo-img { height: 40px; width: auto; }
.navbar-links { display: flex; align-items: center; gap: 4px; }
.navbar-links a:not(.btn) { color: var(--gray-700); font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 8px; transition: all .15s; }
.navbar-links a:not(.btn):hover, .navbar-links a.active { background: var(--gray-100); color: var(--primary); }
.navbar-toggle { display: none; background: none; border: none; flex-direction: column; gap: 5px; padding: 8px; cursor: pointer; }
.navbar-toggle span { width: 24px; height: 2px; background: var(--gray-700); border-radius: 2px; display: block; transition: all .3s; }

/* Lang Switcher */
.lang-switcher { position: relative; }
.lang-current { background: var(--gray-100); border: none; padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.lang-dropdown { display: none; position: absolute; top: 110%; right: 0; background: #fff; border: 1px solid var(--gray-200); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 140px; overflow: hidden; z-index: 100; }
.rtl .lang-dropdown { right: auto; left: 0; }
.lang-switcher:hover .lang-dropdown { display: block; }
.lang-dropdown a { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 13px; color: var(--gray-700); }
.lang-dropdown a:hover, .lang-dropdown a.active { background: var(--gray-50); color: var(--primary); }

/* ═══ HERO ═══ */
.hero-section { background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #2563eb 100%); color: #fff; position: relative; overflow: hidden; }
.hero { padding: 80px 20px 70px; position: relative; display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; max-width: 1160px; margin: 0 auto; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; text-align: center; } .hero-visual { display: none; } }
.hero-content { display: flex; flex-direction: column; justify-content: center; }
.hero-badge { display: inline-flex; align-items: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); padding: 8px 20px; border-radius: 999px; font-size: 13px; margin-bottom: 24px; width: fit-content; }
.hero-title { font-size: clamp(26px,3.8vw,46px); font-weight: 900; line-height: 1.3; margin-bottom: 20px; }
.hero-gradient { background: linear-gradient(135deg, #60a5fa, #a78bfa, #34d399); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-desc { font-size: 18px; opacity: .85; margin-bottom: 36px; line-height: 1.8; max-width: 560px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 30px; font-weight: 900; }
.hero-stat span { font-size: 12px; opacity: .7; }
.hero-stat-sep { width: 1px; background: rgba(255,255,255,.2); height: 40px; align-self: center; }

/* Hero Visual */
.hero-visual { position: relative; display: flex; align-items: center; justify-content: center; }
.hero-device { background: rgba(255,255,255,.08); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.15); border-radius: 16px; }
.hero-device-main { width: 100%; padding: 14px; }
.device-bar { width: 60px; height: 6px; background: rgba(255,255,255,.2); border-radius: 3px; margin-bottom: 16px; }
.device-row { height: 10px; background: rgba(255,255,255,.15); border-radius: 5px; margin-bottom: 8px; }
.device-row.short { width: 60%; }
.device-metric { background: rgba(255,255,255,.1); border-radius: 10px; padding: 14px; margin-top: 12px; }
.device-metric span { font-size: 11px; opacity: .7; display: block; margin-bottom: 8px; }
.metric-bar { height: 6px; background: rgba(255,255,255,.2); border-radius: 3px; margin-bottom: 8px; overflow: hidden; }
.metric-fill { height: 100%; background: linear-gradient(90deg, #4ade80, #22d3ee); border-radius: 3px; }
.device-metric strong { font-size: 13px; color: #4ade80; }
.hero-device-float { padding: 8px 12px; position: absolute; text-align: center; animation: float-card 3s ease-in-out infinite; transform: scale(0.75); }
.hero-device-float-1 { top: 10px; right: -20px; animation-delay: 0s; }
.hero-device-float-2 { bottom: 20px; left: -10px; animation-delay: 1.5s; }
@keyframes float-card { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }

/* ═══ SECTIONS ═══ */
.section { padding: 88px 0; }
.section-gray { background: var(--gray-50); }
.section-header { text-align: center; margin-bottom: 52px; }
.section-badge { display: inline-block; background: var(--primary-light); color: var(--primary); padding: 6px 18px; border-radius: 999px; font-size: 12px; font-weight: 700; margin-bottom: 14px; }
.section-header h2 { font-size: clamp(26px,4vw,40px); font-weight: 800; margin-bottom: 12px; }
.section-header p { color: var(--gray-500); max-width: 540px; margin: 0 auto; }
.page-hero { background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff; padding: 64px 20px; text-align: center; }
.page-hero h1 { font-size: clamp(28px,4vw,44px); font-weight: 800; margin-bottom: 10px; }
.page-hero p { opacity: .85; font-size: 16px; }

/* ═══ PRODUCTS ═══ */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px,1fr)); gap: 24px; }
.product-card { border: 1.5px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; background: #fff; transition: all .3s cubic-bezier(.4,0,.2,1); }
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-6px); }
.product-card-top { padding: 28px 24px; color: #fff; position: relative; overflow: hidden; }
.product-icon { font-size: 48px; position: relative; z-index: 1; }
.product-badge-tag { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,.25); padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; backdrop-filter: blur(4px); }
.rtl .product-badge-tag { right: auto; left: 14px; }
.product-glow { position: absolute; bottom: -20px; right: -20px; width: 80px; height: 80px; border-radius: 50%; opacity: .2; filter: blur(20px); }
.product-card-body { padding: 22px; }
.product-cat { font-size: 11px; color: var(--gray-500); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.product-card-body h3 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.product-card-body > p { font-size: 13px; color: var(--gray-500); margin-bottom: 14px; line-height: 1.7; }
.product-features { margin-bottom: 18px; }
.product-features li { font-size: 13px; padding: 4px 0; color: var(--gray-700); display: flex; align-items: center; gap: 6px; }
.check { color: var(--green); font-weight: 700; }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--gray-100); }
.product-price { font-size: 13px; }
.price-free { color: var(--green); font-weight: 800; font-size: 15px; }
.price-premium { display: block; font-size: 11px; color: var(--gray-500); }
.price-from { color: var(--gray-500); font-size: 12px; }
.product-price strong { font-size: 20px; color: var(--primary); }

/* ═══ PLANS ═══ */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); gap: 20px; }
.plan-card { background: #fff; border: 2px solid var(--gray-200); border-radius: 16px; padding: 28px; position: relative; transition: all .2s; }
.plan-card:hover { box-shadow: var(--shadow-lg); }
.plan-card.plan-featured { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
.plan-card.plan-current { border-color: var(--green); }
.plan-popular { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 4px 18px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.plan-header { margin-bottom: 18px; }
.plan-name { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.plan-price { font-size: 38px; font-weight: 900; color: var(--primary); }
.plan-price span { font-size: 14px; color: var(--gray-500); font-weight: 400; }
.plan-features { margin: 16px 0 22px; }
.plan-features li { padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--gray-100); }
.plan-features li:last-child { border: none; }

/* ═══ WHY GRID ═══ */
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 22px; }
.why-card { padding: 28px; border: 1.5px solid var(--gray-200); border-radius: var(--radius); text-align: center; transition: all .2s; }
.why-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.why-icon { font-size: 36px; margin-bottom: 14px; }
.why-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.why-card p { font-size: 13px; color: var(--gray-500); line-height: 1.7; }

/* ═══ CTA ═══ */
.section-cta { background: linear-gradient(135deg, var(--primary-dark), var(--primary), #7c3aed); color: #fff; padding: 88px 20px; text-align: center; position: relative; overflow: hidden; width: 100%; }
.cta-content h2 { font-size: clamp(26px,4vw,42px); font-weight: 800; margin-bottom: 14px; }
.cta-content p { font-size: 17px; opacity: .85; margin-bottom: 32px; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ═══ FOOTER ═══ */
.site-footer { background: var(--gray-900); color: rgba(255,255,255,.6); padding: 64px 20px 0; width: 100%; }
.footer-wrap { max-width: 1160px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; }
.footer-logo { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 12px; }
.footer-brand p { font-size: 13px; line-height: 1.8; }
.footer-email { color: var(--primary); font-size: 13px; }
.footer-col h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a { color: rgba(255,255,255,.6); font-size: 13px; }
.footer-col ul a:hover { color: #fff; }
.footer-lang-btn { display: inline-block; color: rgba(255,255,255,.5); font-size: 12px; padding: 5px 12px; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; margin-left: 6px; margin-bottom: 6px; transition: all .15s; }
.footer-lang-btn.active { color: #fff; border-color: rgba(255,255,255,.4); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; text-align: center; font-size: 12px; }

/* ═══ AUTH ═══ */
.auth-page { min-height: calc(100vh - 68px); display: flex; align-items: center; justify-content: center; padding: 48px 20px; background: linear-gradient(135deg, #eff6ff, #faf5ff); }
.auth-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 440px; padding: 44px; }
.auth-card-wide { max-width: 560px; }
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-logo { font-size: 22px; font-weight: 800; color: var(--primary); margin-bottom: 14px; }
.auth-header h1 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.auth-header p { color: var(--gray-500); font-size: 14px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--gray-500); }
.auth-footer a { color: var(--primary); font-weight: 700; }

/* ═══ PRODUCT DETAIL ═══ */
.product-hero-section { padding: 60px 20px; }
.product-hero-inner { display: grid; grid-template-columns: 2fr 1fr; gap: 48px; align-items: center; max-width: 1160px; margin: 0 auto; }
.product-cat-badge { display: inline-block; padding: 5px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; margin-bottom: 14px; }
.product-hero-text h1 { font-size: clamp(28px,5vw,46px); font-weight: 900; margin-bottom: 10px; }
.product-tagline { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.product-hero-text > p { color: var(--gray-500); margin-bottom: 24px; }
.product-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.product-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.product-meta span { background: var(--gray-100); padding: 4px 12px; border-radius: 999px; font-size: 12px; color: var(--gray-500); }
.product-hero-icon-wrap { text-align: center; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 16px; }
.feature-item { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--gray-50); border-radius: 10px; font-weight: 600; font-size: 14px; }
.check-icon { color: var(--green); font-weight: 900; font-size: 16px; flex-shrink: 0; }

/* ═══ FAQ ═══ */
.faq-list { margin-top: 24px; }
.faq-item { border: 1.5px solid var(--gray-200); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.faq-item.open { border-color: var(--primary); }
.faq-q { padding: 18px 22px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.faq-q:hover { background: var(--gray-50); }
.faq-a { padding: 0 22px; max-height: 0; overflow: hidden; transition: all .3s; font-size: 14px; color: var(--gray-500); line-height: 1.8; }
.faq-item.open .faq-a { padding: 0 22px 18px; max-height: 400px; }

/* ═══ SITEMAP ═══ */
.sitemap-section { padding: 60px 20px; }

/* ══ Responsive ══ */
@media (max-width: 900px) { .product-hero-inner { grid-template-columns: 1fr; } .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px) {
  .navbar-links { display: none; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0; background: #fff; padding: 16px; border-bottom: 1px solid var(--gray-200); box-shadow: var(--shadow-md); z-index: 999; }
  .navbar-links.open { display: flex; }
  .navbar-toggle { display: flex; }
  .form-row { grid-template-columns: 1fr; }
  .hero-actions { justify-content: center; }
}
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
