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

/* CSS Variables & Design System */
:root {
  --bg-color: #06070d;
  --bg-gradient: radial-gradient(circle at 50% 0%, #15122b 0%, #06070d 70%);
  --panel-bg: rgba(20, 22, 39, 0.45);
  --panel-border: rgba(255, 255, 255, 0.06);
  --panel-border-hover: rgba(0, 242, 254, 0.25);
  
  --primary: #00f2fe;
  --primary-glow: rgba(0, 242, 254, 0.15);
  --secondary: #e100ff;
  --secondary-glow: rgba(225, 0, 255, 0.15);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-active: #00f2fe;
  
  --font-ar: 'Cairo', sans-serif;
  --font-en: 'Outfit', sans-serif;
  
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --border-radius: 18px;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg-color);
}

body {
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  font-family: var(--font-ar);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

/* Header & Navigation */
header {
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: blur(12px);
  background: rgba(6, 7, 13, 0.7);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

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

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #000;
  font-size: 20px;
  font-family: var(--font-en);
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(to left, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: var(--font-en);
  letter-spacing: 1px;
}

.logo-badge {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--primary);
  border-radius: 20px;
  font-weight: 600;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 80px 0 60px 0;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
}

.hero-title span {
  background: linear-gradient(to left, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 36px auto;
  font-weight: 400;
}

/* Search and Filters */
.search-container {
  max-width: 550px;
  margin: 0 auto 40px auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 16px 24px 16px 56px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 30px;
  color: var(--text-main);
  font-family: var(--font-ar);
  font-size: 16px;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition);
}

.search-input:focus + .search-icon {
  color: var(--primary);
}

/* Filter Tags */
.filter-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.filter-btn {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  padding: 10px 22px;
  border-radius: 25px;
  cursor: pointer;
  font-family: var(--font-ar);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  backdrop-filter: blur(5px);
}

.filter-btn:hover {
  border-color: var(--primary-glow);
  color: var(--text-main);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #000;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

/* Application Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  margin-bottom: 80px;
}

/* App Card styling */
.app-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to left, var(--primary), var(--secondary));
  opacity: 0;
  transition: var(--transition);
}

.app-card:hover {
  transform: translateY(-8px);
  border-color: var(--panel-border-hover);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 242, 254, 0.05);
}

.app-card:hover::before {
  opacity: 1;
}

.app-card-header {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.app-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.03);
}

.app-logo svg {
  width: 100%;
  height: 100%;
}

.app-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  direction: ltr;
  text-align: right;
}

.app-category {
  font-size: 12px;
  color: var(--primary);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.app-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.app-rating {
  color: #ffb800;
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

.app-description {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 66px;
}

.app-card-footer {
  display: flex;
  gap: 12px;
  margin-top: auto;
  align-items: center;
}

.btn {
  padding: 12px 20px;
  border-radius: 12px;
  font-family: var(--font-ar);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #000;
  flex-grow: 1;
  box-shadow: 0 4px 12px rgba(0, 242, 254, 0.15);
}

.btn-primary:hover {
  box-shadow: 0 6px 18px rgba(0, 242, 254, 0.35);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 12px 14px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary);
  border-color: var(--primary);
}

/* Downloader Code Quick-Badge */
.downloader-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255, 80, 0, 0.12);
  border: 1px solid rgba(255, 80, 0, 0.3);
  color: #ff6a00;
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-en);
}

/* Firestick Installation Guide Section */
.guide-section {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 50px 40px;
  margin-bottom: 80px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.guide-section::after {
  content: '';
  position: absolute;
  bottom: -150px;
  left: -150px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--secondary-glow) 0%, transparent 70%);
  pointer-events: none;
}

.guide-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  text-align: center;
}

.guide-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  text-align: center;
  max-width: 600px;
  margin: 0 auto 40px auto;
}

.steps-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.step-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 24px;
  border-radius: 16px;
  position: relative;
  transition: var(--transition);
}

.step-card:hover {
  border-color: var(--primary-glow);
  background: rgba(255, 255, 255, 0.04);
}

.step-num {
  font-family: var(--font-en);
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 12px;
}

.step-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.step-card p {
  font-size: 14px;
  color: var(--text-muted);
}

/* Detail Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 4, 8, 0.85);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #0d0f1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-backdrop.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: var(--transition);
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 0, 0, 0.2);
  color: #ff5555;
  transform: rotate(90deg);
}

.modal-body {
  padding: 40px;
}

.modal-header-section {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 30px;
}

.modal-logo {
  width: 90px;
  height: 90px;
  border-radius: 20px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.03);
}

.modal-logo svg {
  width: 100%;
  height: 100%;
}

.modal-header-info {
  flex-grow: 1;
}

.modal-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-main);
}

.modal-detail-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.m-badge {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.m-badge.primary {
  background: rgba(0, 242, 254, 0.1);
  border-color: rgba(0, 242, 254, 0.2);
  color: var(--primary);
}

.m-badge.orange {
  background: rgba(255, 80, 0, 0.1);
  border-color: rgba(255, 80, 0, 0.2);
  color: #ff5000;
  font-family: var(--font-en);
}

/* Grid layout for modal downloads & QR */
.modal-grid-actions {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  margin-bottom: 30px;
}

.download-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.qr-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.qr-code-wrapper {
  background: white;
  padding: 8px;
  border-radius: 10px;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.qr-code-wrapper img {
  width: 100%;
  height: 100%;
}

.qr-text {
  font-size: 11px;
  color: var(--text-muted);
}

/* Download Simulation Animation */
.download-progress-container {
  display: none;
  margin-top: 16px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(to left, var(--primary), var(--secondary));
  transition: width 0.1s linear;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* App Features */
.features-section {
  margin-bottom: 30px;
}

.features-section h4 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--primary);
}

.features-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.features-list li {
  font-size: 14px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.features-list li::before {
  content: '✓';
  color: var(--primary);
  font-weight: bold;
}

/* Dynamic Screenshots / Mockups Carousel styling */
.screenshot-slider-container {
  margin-top: 24px;
}

.screenshot-slider-container h4 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--primary);
}

.slides-wrapper {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
}

.slide-item {
  flex: 0 0 180px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
  scroll-snap-align: start;
}

.mockup-screen {
  height: 260px;
  border-radius: 8px;
  background: linear-gradient(135deg, #18192a, #080911);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 10px;
}

.mockup-screen::after {
  content: 'IPTV TECH MOCKUP';
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.15);
  font-family: var(--font-en);
}

.mockup-inner-glow {
  position: absolute;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.2) 0%, transparent 60%);
  pointer-events: none;
}

.slide-item h5 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.slide-item p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Contact / Support Section */
.contact-section {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 50px 40px;
  text-align: center;
  margin-bottom: 80px;
}

.contact-channels {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.channel-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: var(--transition);
  color: white;
}

.channel-tg {
  background: #0088cc;
  box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}
.channel-tg:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 136, 204, 0.5);
}

.channel-wa {
  background: #25d366;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}
.channel-wa:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

/* Footer styling */
footer {
  border-top: 1px solid var(--panel-border);
  padding: 40px 0;
  background: #030408;
  color: var(--text-muted);
  font-size: 14px;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-logo span {
  font-family: var(--font-en);
  font-weight: 800;
  color: var(--text-main);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    padding-top: 0;
  }
  .hero-title {
    font-size: 32px;
  }
  .guide-section, .contact-section {
    padding: 30px 20px;
  }
  .modal-body {
    padding: 24px;
  }
  .modal-grid-actions {
    grid-template-columns: 1fr;
  }
  .features-list {
    grid-template-columns: 1fr;
  }
  .modal-header-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .modal-detail-badges {
    justify-content: center;
  }
  .footer-container {
    flex-direction: column;
    text-align: center;
  }
}
