/* =====================================================================
   Devlex Infotech — Apple App Store Live Apps Showcase
   Fully responsive across Desktop, Tablet, and Mobile devices (320px - 1440px+)
   ===================================================================== */

.section-appstore {
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border, #E2E8F0);
  border-bottom: 1px solid var(--border, #E2E8F0);
}

/* Subtle decorative background gradient glows */
.section-appstore::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -80px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.section-appstore::after {
  content: "";
  position: absolute;
  bottom: -100px;
  left: -80px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, rgba(16, 185, 129, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.section-appstore .container {
  position: relative;
  z-index: 1;
}

/* Header & Controls */
.appstore-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.appstore-header-copy {
  max-width: 720px;
  flex: 1 1 400px;
}

.appstore-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #065F46;
  margin-bottom: 14px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  display: inline-block;
  animation: livePulse 2s infinite ease-in-out;
}

@keyframes livePulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.live-count {
  background: #10B981;
  color: #FFFFFF;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.appstore-header h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  color: var(--navy, #0F172A);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.appstore-header .section-sub {
  font-size: 1.02rem;
  color: var(--text-muted, #475569);
  line-height: 1.6;
  margin: 0;
}

/* Official Apple Developer Account Link Button */
.appstore-header-cta {
  flex-shrink: 0;
}

.appstore-dev-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #000000;
  color: #FFFFFF;
  padding: 11px 18px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.appstore-dev-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  background: #1A1A1A;
  color: #FFFFFF;
}

.appstore-dev-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}

.appstore-dev-btn-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.appstore-dev-btn-text .btn-sub {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
  font-weight: 500;
}

.appstore-dev-btn-text .btn-main {
  font-size: 0.95rem;
  font-weight: 700;
}

.appstore-dev-btn .arrow-icon {
  font-size: 1rem;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.appstore-dev-btn:hover .arrow-icon {
  transform: translate(2px, -2px);
  opacity: 1;
}

/* Filter Buttons */
.appstore-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 30px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.appstore-filters::-webkit-scrollbar {
  display: none;
}

.appstore-filter-btn {
  background: #FFFFFF;
  border: 1px solid var(--border, #E2E8F0);
  color: var(--text-muted, #475569);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.appstore-filter-btn:hover {
  border-color: var(--blue, #2563EB);
  color: var(--blue, #2563EB);
}

.appstore-filter-btn.is-active {
  background: var(--navy, #0F172A);
  color: #FFFFFF;
  border-color: var(--navy, #0F172A);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

/* App Grid */
.appstore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}

/* App Card */
.appstore-card {
  background: #FFFFFF;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
  height: 100%;
}

.appstore-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px -12px rgba(15, 23, 42, 0.14);
  border-color: rgba(37, 99, 235, 0.35);
}

/* Top: Icon + Title + Meta */
.app-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.app-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 22.37%; /* Apple standard squircle */
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
  background: #F1F5F9;
  position: relative;
}

.app-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-card-meta {
  flex: 1;
  min-width: 0; /* Prevents flex children from overflowing */
}

.app-card-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--navy, #0F172A);
  line-height: 1.32;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.app-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease;
}

.app-card-title a:hover {
  color: var(--blue, #2563EB);
}

.app-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.app-badge-genre {
  background: var(--slate-100, #F1F5F9);
  color: var(--text-soft, #64748B);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.app-badge-tag {
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue, #2563EB);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.app-badge-site {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.app-badge-site:hover {
  background: #10B981;
  color: #FFFFFF;
  border-color: #10B981;
}

.app-badge-new {
  background: #EF4444;
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  animation: livePulse 2s infinite ease-in-out;
}

/* App Description */
.app-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted, #475569);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

/* Screenshots Preview Horizontal Strip */
.app-card-screenshots-wrap {
  margin-bottom: 18px;
  background: #F8FAFC;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 14px;
  padding: 10px;
}

.app-card-screenshots-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.15) transparent;
  padding-bottom: 4px;
}

.app-card-screenshots-strip::-webkit-scrollbar {
  height: 4px;
}

.app-card-screenshots-strip::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.15);
  border-radius: 4px;
}

.app-ss-thumb {
  flex: 0 0 86px;
  aspect-ratio: 9 / 19.5;
  border-radius: 9px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  position: relative;
  scroll-snap-align: start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.app-ss-thumb:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.app-ss-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-ss-more-badge {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(2px);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  gap: 2px;
  border-radius: 9px;
  text-align: center;
}

/* Card Bottom Actions — BULLETPROOF RESPONSIVE LAYOUT */
.app-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  flex-wrap: wrap; /* Allows natural wrapping without squishing */
}

/* Primary App Store Button */
.btn-appstore-get {
  flex: 1 1 150px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #000000;
  color: #FFFFFF;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  min-height: 40px;
}

.btn-appstore-get svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: block;
  margin-top: -2px;
}

.btn-appstore-get:hover {
  background: var(--blue, #2563EB);
  color: #FFFFFF;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

/* Website Button (Secondary Action) */
.btn-appstore-web {
  flex: 1 1 95px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  color: var(--navy, #0F172A);
  border: 1px solid var(--border, #E2E8F0);
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: inherit;
  gap: 5px;
  white-space: nowrap;
  min-height: 40px;
}

.btn-appstore-web svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
}

.btn-appstore-web:hover {
  background: var(--navy, #0F172A);
  color: #FFFFFF;
  border-color: var(--navy, #0F172A);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  transform: translateY(-1px);
}

/* Screenshots Preview Button */
.btn-appstore-preview {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  color: var(--navy, #0F172A);
  border: 1px solid var(--border, #E2E8F0);
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  gap: 5px;
  white-space: nowrap;
  min-height: 40px;
}

.btn-appstore-preview:hover {
  background: var(--slate-100, #F1F5F9);
  border-color: var(--text-muted, #475569);
  color: var(--blue, #2563EB);
}

/* When a card has 3 buttons (like Kankotri with website):
   The primary 'Get on App Store' cleanly sits across top,
   and 'Website' + 'Screenshots' share row 2 evenly! */
.appstore-card[data-website] .btn-appstore-get {
  flex: 1 1 100%;
}

.appstore-card[data-website] .btn-appstore-web,
.appstore-card[data-website] .btn-appstore-preview {
  flex: 1 1 calc(50% - 4px);
}

/* Live Auto-Sync Status Bar */
.appstore-live-status {
  background: #FFFFFF;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 14px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--text-muted, #475569);
  flex-wrap: wrap;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-icon-live {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10B981;
  display: inline-block;
  animation: livePulse 2.5s infinite;
  flex-shrink: 0;
}

.appstore-link-all {
  color: var(--blue, #2563EB);
  font-weight: 600;
  text-decoration: none;
  transition: gap 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.appstore-link-all:hover {
  text-decoration: underline;
}

/* =====================================================================
   Lightbox Modal for Fullscreen Screenshots & App Details
   ===================================================================== */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.app-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.app-modal-container {
  position: relative;
  z-index: 2;
  background: #FFFFFF;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  border-radius: 24px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-modal.is-open .app-modal-container {
  transform: scale(1);
}

.app-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border, #E2E8F0);
  background: #FFFFFF;
  gap: 14px;
}

.modal-app-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.modal-app-icon {
  width: 48px;
  height: 48px;
  border-radius: 22.37%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-app-titles {
  min-width: 0;
}

.modal-app-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--navy, #0F172A);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-app-genre {
  font-size: 0.8rem;
  color: var(--text-soft, #64748B);
  font-weight: 500;
}

.app-modal-close-btn {
  background: var(--slate-100, #F1F5F9);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--text-muted, #475569);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.app-modal-close-btn:hover {
  background: #E2E8F0;
  color: var(--navy, #0F172A);
  transform: rotate(90deg);
}

/* Modal Body: Screenshots Slider */
.app-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-slider-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}

.modal-slider-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px 4px;
  scrollbar-width: thin;
  max-width: 100%;
}

.modal-slide-item {
  flex: 0 0 220px;
  aspect-ratio: 9 / 19.5;
  border-radius: 16px;
  overflow: hidden;
  scroll-snap-align: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
  background: #000;
  border: 2px solid rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
}

.modal-slide-item:hover {
  transform: translateY(-4px);
}

.modal-slide-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Modal Footer */
.app-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--border, #E2E8F0);
  background: var(--slate-50, #F8FAFC);
  gap: 12px;
  flex-wrap: wrap;
}

.modal-footer-notes {
  font-size: 0.84rem;
  color: var(--text-soft, #64748B);
}

.modal-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #000000;
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.modal-footer-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: block;
  margin-top: -2px;
}

.modal-footer-btn:hover {
  background: var(--blue, #2563EB);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.3);
}

.modal-footer-web-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  color: var(--navy, #0F172A);
  border: 1px solid var(--border, #E2E8F0);
  padding: 10px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.modal-footer-web-btn svg {
  width: 15px;
  height: 15px;
}

.modal-footer-web-btn:hover {
  background: var(--navy, #0F172A);
  color: #FFFFFF;
  border-color: var(--navy, #0F172A);
}

/* =====================================================================
   RESPONSIVE BREAKPOINTS (Tablets, iPads, Phones)
   ===================================================================== */

/* Tablet & Smaller Laptops (<= 1024px) */
@media (max-width: 1024px) {
  .appstore-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
  }
}

/* Tablets (<= 768px) */
@media (max-width: 768px) {
  .section-appstore {
    padding: 60px 0;
  }

  .appstore-header {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .appstore-header-copy {
    max-width: 100%;
  }

  .appstore-dev-btn {
    width: 100%;
    justify-content: center;
  }

  .appstore-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .appstore-live-status {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    text-align: left;
  }

  .modal-slide-item {
    flex: 0 0 190px;
  }
}

/* Mobile Phones (<= 480px) */
@media (max-width: 480px) {
  .section-appstore {
    padding: 48px 0;
  }

  .appstore-card {
    padding: 16px 14px;
    border-radius: 16px;
  }

  .app-card-icon {
    width: 54px;
    height: 54px;
  }

  .app-card-title {
    font-size: 1.05rem;
  }

  .app-ss-thumb {
    flex: 0 0 76px;
  }

  .app-card-screenshots-wrap {
    padding: 8px;
  }

  .btn-appstore-get {
    font-size: 0.82rem;
    padding: 9px 12px;
  }

  .btn-appstore-web,
  .btn-appstore-preview {
    font-size: 0.78rem;
    padding: 8px 10px;
  }

  .app-modal {
    padding: 10px;
  }

  .app-modal-container {
    max-height: 94vh;
    border-radius: 18px;
  }

  .app-modal-header,
  .app-modal-footer {
    padding: 12px 16px;
  }

  .modal-slide-item {
    flex: 0 0 155px;
  }

  .app-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-footer-btn,
  .modal-footer-web-btn {
    width: 100%;
    justify-content: center;
  }
}
