:root {
  --primary-color: #00eaff;
  --secondary-color: #00c4d4;
  --bg-dark: #0d0d0d;
  --bg-card: #141414;
  --text-main: #ffffff;
  --text-muted: #cccccc;
  --shadow-glow: 0 0 15px rgba(0, 234, 255, 0.2);
  --border-color: #1d1d1d;
  --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

header {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(180deg, rgba(14, 14, 14, 1) 0%, rgba(28, 28, 28, 0) 100%);
  border-bottom: 1px solid rgba(0, 234, 255, 0.1);
}

header .logo {
  width: 140px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 20px rgba(0, 234, 255, 0.3));
  transition: transform 0.3s ease;
}

header .logo:hover {
  transform: scale(1.05);
}

header h1 {
  margin: 0;
  font-size: 2.5rem;
  color: var(--primary-color);
  text-shadow: 0 0 20px rgba(0, 234, 255, 0.4);
}

header p {
  margin-top: 10px;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.search-container {
  margin-top: 25px;
  position: relative;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

#searchInput {
  width: 100%;
  padding: 15px 20px;
  font-size: 1rem;
  border-radius: 50px;
  border: 1px solid rgba(0, 234, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  text-align: center;
}

#searchInput:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 20px rgba(0, 234, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

#searchInput::placeholder {
  color: #888;
}

.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  background-color: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--primary-color);
  box-shadow: 0 10px 30px rgba(0, 234, 255, 0.15);
}

.card.featured {
  border: 1px solid rgba(0, 234, 255, 0.5);
}

.card.featured::before {
  content: '★ مميز';
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary-color);
  color: #000;
  font-size: 0.8rem;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 10;
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover img {
  transform: scale(1.05);
}

.card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card h3 {
  margin: 0 0 10px 0;
  color: var(--primary-color);
  font-size: 1.3rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-btn {
  display: block;
  text-align: center;
  padding: 12px;
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  font-weight: bold;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.card-btn:hover {
  background-color: var(--primary-color);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 234, 255, 0.4);
}

/* Detail Page Styles */
.detail-page-header {
  margin-bottom: 40px;
}

.back-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 20px;
  background: rgba(0, 234, 255, 0.1);
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 30px;
  backdrop-filter: blur(10px);
  z-index: 1000;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-btn:hover {
  background: var(--primary-color);
  color: #000;
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  /* 16:9 Aspect Ratio */
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 30px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  border: 1px solid #333;
}

.video-container iframe,
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.content-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 20px;
}

.content-text h1,
.content-text h2 {
  color: var(--primary-color);
}

.btn-download {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 40px auto;
  padding: 20px;
  background: var(--primary-color);
  color: #000;
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 12px;
  text-decoration: none;
  transition: 0.3s;
  box-shadow: 0 0 30px rgba(0, 234, 255, 0.2);
}

.btn-download:hover {
  background: var(--secondary-color);
  transform: scale(1.02);
  box-shadow: 0 0 50px rgba(0, 234, 255, 0.4);
}

footer {
  text-align: center;
  padding: 40px 20px;
  margin-top: 60px;
  border-top: 1px solid #222;
  color: #666;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.social-icons a svg {
  transition: transform 0.3s ease, fill 0.3s ease;
}

.social-icons a:hover svg {
  transform: translateY(-5px);
  filter: drop-shadow(0 0 10px currentColor);
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }

  header p {
    font-size: 1rem;
  }

  .container {
    grid-template-columns: 1fr;
    /* Stack cards vertically */
    padding: 0 15px;
  }

  .detail-page-header h1 {
    font-size: 1.5rem;
  }

  .img-wrapper img {
    height: 200px;
    /* Adjust image height for mobile */
  }
}

@media (min-width: 769px) {
  .container {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
  /* Hidden by default */
}

/* Ads Responsive Logic */
.mobile-bottom-ad {
  display: none;
  width: 100%;
  text-align: center;
  margin: 40px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.mobile-bottom-ad img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1300px) {
  .side-ads {
    display: none !important;
  }

  .mobile-bottom-ad {
    display: block;
  }
}

/* Scroll to Top Button */
#scrollTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: #000;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 234, 255, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

#scrollTopBtn.show {
  opacity: 1;
  visibility: visible;
}

#scrollTopBtn:hover {
  transform: translateY(-5px);
  background: var(--secondary-color);
}

/* Unlock / Activation Box */
.unlock-box {
  background: rgba(0, 234, 255, 0.05);
  border: 1px solid var(--primary-color);
  border-radius: 12px;
  padding: 30px;
  margin: 40px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.unlock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.unlock-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  width: 100%;
}

.unlock-btn {
  flex: 1;
  min-width: 200px;
  background: var(--primary-color);
  color: #000;
  padding: 15px 25px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.unlock-btn.sub-btn {
  background: #ff0000;
  color: #fff;
}

.unlock-btn.like-btn {
  background: #1877f2;
  color: #fff;
}

.unlock-btn:hover {
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.unlock-btn.done {
  background: #28a745 !important;
  color: #fff !important;
  cursor: default;
}

.unlock-btn.waiting {
  background: #444;
  color: #888;
  cursor: not-allowed;
}

.reveal-content {
  display: none;
  background: #000;
  color: #0f0;
  padding: 15px;
  font-family: 'Consolas', monospace;
  border-radius: 8px;
  font-size: 1.1rem;
  width: 100%;
  cursor: pointer;
  position: relative;
  border: 1px solid #333;
}

.reveal-content.show {
  display: block;
}

.reveal-content.is-link {
  color: var(--primary-color);
  text-decoration: underline;
}

.reveal-content::after {
  content: 'اضغط للنسخ';
  position: absolute;
  top: -10px;
  left: 10px;
  background: var(--primary-color);
  color: #000;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-main);
}

.reveal-content.is-link::after {
  display: none;
}

.download-link-btn {
  display: none;
  background: linear-gradient(135deg, #00c4d4, #00eaff);
  color: #000 !important;
  padding: 20px;
  border-radius: 12px;
  font-weight: bold;
  text-decoration: none !important;
  font-size: 1.2rem;
  text-align: center;
  width: 100%;
  box-shadow: 0 10px 20px rgba(0, 234, 255, 0.3);
  transition: 0.3s;
  border: none;
  animation: pulseGlow 2s infinite;
}

.download-link-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 234, 255, 0.5);
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 10px rgba(0, 234, 255, 0.3);
  }

  50% {
    box-shadow: 0 0 30px rgba(0, 234, 255, 0.6);
  }

  100% {
    box-shadow: 0 0 10px rgba(0, 234, 255, 0.3);
  }
}

.unlock-msg {
  margin-top: 15px;
  font-size: 0.9rem;
  color: #aaa;
  display: none;
}

/* Generalized Image Wrapper and Feature Boxes */
.image-wrapper {
  display: block;
  margin-bottom: 30px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(0, 234, 255, 0.2);
  transition: 0.3s;
  position: relative;
  cursor: pointer;
}

.image-wrapper:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 30px rgba(0, 234, 255, 0.2);
}

.image-wrapper img {
  width: 100%;
  display: block;
}

.image-overlay {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: bold;
  pointer-events: none;
  backdrop-filter: blur(5px);
}

.feature-box {
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border-right: 4px solid var(--primary-color);
  border-radius: 4px;
}

.feature-box h3 {
  margin-top: 0;
  color: var(--primary-color);
}