/* ============================================
   IPTV Nordic — apps-pages.css
   Shared styles for 4 IPTV app pages:
   IPTV Smarters Pro, Smart IPTV, TiviMate, IBO Player Pro
   ============================================ */

/* ── Hero quick-box ── */
.qb-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0.85rem;
}
.qb-list li {
  padding: 0.3rem 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
}
.qb-list strong { color: #ffd54f; }
.qb-foot {
  margin: 0.5rem 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}

/* ============================================================
   TMDB strip (reused)
   ============================================================ */
.hero-tmdb-strip {
  background: linear-gradient(180deg, #f9fafb 0%, #ffffff 100%);
  padding: 2.5rem 0 3rem;
  overflow: hidden;
}
.strip-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
}
.strip-title {
  font-size: clamp(1.4rem, 3.2vw, 1.85rem);
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.strip-subtitle { color: #6b7280; font-size: 1rem; margin: 0; }
.tmdb-strip-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 1rem 2rem;
  -webkit-overflow-scrolling: touch;
}
.tmdb-strip-track::-webkit-scrollbar { height: 6px; }
.tmdb-strip-track::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.strip-movie-card {
  flex: 0 0 180px;
  height: 270px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  background: #f3f4f6;
}
.strip-movie-card:hover {
  transform: scale(1.05) translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}
.strip-movie-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip-movie-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.85) 100%);
  padding: 1.5rem 0.75rem 0.75rem; color: #fff;
}
.strip-movie-rating { font-size: 0.85rem; font-weight: 600; color: #fbbf24; }
@media (max-width: 600px) {
  .strip-movie-card { flex: 0 0 140px; height: 210px; }
  .tmdb-strip-track { padding: 1rem; }
}

/* ============================================================
   Content image block
   ============================================================ */
.content-image-block {
  margin: 2.25rem auto;
  max-width: 900px;
}
.content-image-block img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  display: block;
}
.content-image-block figcaption {
  margin-top: 0.85rem;
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
  font-style: italic;
  line-height: 1.5;
  padding: 0 0.5rem;
}

/* ============================================================
   App info card (Section 5 — pris og tilgængelighed)
   ============================================================ */
.app-info-card {
  max-width: 880px;
  margin: 1.5rem auto;
  padding: 1.75rem 1.75rem 1.5rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 60%, #f8fbff 100%);
  border: 1.5px solid #93c5fd;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(25, 118, 210, 0.08);
}

.app-info-card h3 {
  margin: 0 0 1rem;
  color: #1e3a8a;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
.app-info-table td {
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(25, 118, 210, 0.12);
  vertical-align: top;
}
.app-info-table tr:last-child td { border-bottom: none; }
.app-info-table td:first-child {
  font-weight: 600;
  color: #1e3a8a;
  width: 35%;
  padding-right: 1rem;
}
.app-info-table td:last-child { color: #1f2937; }

/* ============================================================
   Download/store badges (Section 5)
   ============================================================ */
.store-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin: 1.25rem 0;
  list-style: none;
  padding: 0;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: #ffffff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.25s ease;
  font-size: 0.9rem;
  color: #1f2937;
}

.store-badge.is-available { border-color: #10b981; background: #ecfdf5; }
.store-badge.is-unavailable {
  border-color: #fecaca;
  background: #fef2f2;
  opacity: 0.85;
  color: #7f1d1d;
}

.store-badge .store-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.store-badge .store-name { font-weight: 600; }
.store-badge .store-status {
  display: block;
  font-size: 0.78rem;
  color: #6b7280;
}
.store-badge.is-available .store-status { color: #065f46; }
.store-badge.is-unavailable .store-status { color: #b91c1c; }

/* ============================================================
   Compatibility grid (Section 6 — devices)
   ============================================================ */
.compat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
}

.compat-card {
  position: relative;
  display: block;
  padding: 1.5rem 1.25rem 1.25rem;
  background: #ffffff;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
}

.compat-card.is-supported { border-color: #10b981; }
.compat-card.is-not-supported {
  border-color: #fecaca;
  background: #fffbfb;
}

.compat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  color: inherit;
}

.compat-status {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}
.compat-card.is-supported .compat-status { background: #10b981; }
.compat-card.is-not-supported .compat-status { background: #dc2626; }

.compat-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.compat-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.02rem;
  color: #111827;
}

.compat-card p {
  margin: 0;
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.45;
}

.compat-card .compat-link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: #1976d2;
  font-weight: 600;
  text-decoration: none;
}

/* ============================================================
   Install steps (reuse from devices-page)
   ============================================================ */
.install-steps {
  list-style: none;
  counter-reset: step-counter;
  padding: 0;
  margin: 1.5rem auto 0;
  max-width: 850px;
}

.install-steps li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1.1rem;
  align-items: start;
  padding: 1.25rem 1.25rem 1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 0.85rem;
  counter-increment: step-counter;
  transition: all 0.2s ease;
}

.install-steps li:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  border-color: #93c5fd;
}

.install-steps li::before {
  content: counter(step-counter, decimal-leading-zero);
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #1976d2 0%, #115293 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(25, 118, 210, 0.28);
  font-feature-settings: 'tnum';
}

.install-steps h3 {
  font-size: 1.05rem;
  margin: 0 0 0.3rem;
  color: #111827;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.install-steps p {
  color: #4b5563;
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
}

.install-steps code {
  background: #f3f4f6;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: #1976d2;
}

@media (max-width: 600px) {
  .install-steps li { grid-template-columns: 44px 1fr; gap: 0.85rem; padding: 1rem; }
  .install-steps li::before { width: 40px; height: 40px; font-size: 0.95rem; }
}

/* ============================================================
   Settings / advanced configuration sub-sections
   ============================================================ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.setting-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.15rem 1.25rem;
}

.setting-card h3 {
  font-size: 1rem;
  color: #1976d2;
  margin: 0 0 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.setting-card p {
  margin: 0;
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ============================================================
   Troubleshooting <details> (reused)
   ============================================================ */
.troubleshooting-list {
  max-width: 880px;
  margin: 1.5rem auto 0;
}

.troubleshooting-list details {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 0.65rem;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.troubleshooting-list details[open] {
  border-color: #f9a825;
  background: #fffbeb;
}

.troubleshooting-list summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
  list-style: none;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}

.troubleshooting-list summary::-webkit-details-marker { display: none; }
.troubleshooting-list summary::before { content: '⚠️'; flex-shrink: 0; }
.troubleshooting-list summary::after {
  content: '+';
  position: absolute;
  right: 1.25rem;
  font-size: 1.5rem;
  color: #6b7280;
  font-weight: 400;
}
.troubleshooting-list details[open] summary::after { content: '−'; }

.troubleshooting-list .answer-body {
  padding: 0.5rem 1.25rem 1.25rem 3rem;
  color: #374151;
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ============================================================
   What you can watch (reuse pattern)
   ============================================================ */
.what-watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
  list-style: none;
  padding: 0;
}

.what-watch-grid li {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #1976d2;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.93rem;
  color: #374151;
  line-height: 1.5;
}

.what-watch-grid li strong { color: #111827; }

/* ============================================================
   Cross-app links (other apps in this category)
   ============================================================ */
.cross-apps-box {
  background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 1.5rem 1.25rem;
  margin: 2rem 0 1rem;
  text-align: center;
}

.cross-apps-box h3 {
  font-size: 1.1rem;
  margin: 0 0 0.85rem;
  color: #111827;
}

.cross-apps-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.cross-apps-list a {
  background: #fff;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: #1565c0;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.cross-apps-list a:hover {
  background: #1976d2;
  color: #fff;
  border-color: #1976d2;
}

/* ============================================================
   Final CTA buttons (reused)
   ============================================================ */
.cta-buttons-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  max-width: 720px;
  margin: 0 auto;
}

@media (max-width: 760px) {
  .cta-buttons-3 { grid-template-columns: 1fr; }
}

/* ============================================================
   Long URL / code overflow fix (xtream-codes-guide table + cards)
   - Targets actual classes in markup: .app-info-table, .store-badge
   - Root cause for flex cards: missing min-width:0 on inner <div>
   ============================================================ */

/* Generic safety net for any <code> element */
code {
  word-break: break-all;
  overflow-wrap: anywhere;
  max-width: 100%;
}

/* App-info-table (Hvad du modtager fra IPTV Nordic) */
.app-info-table { table-layout: fixed; }

.app-info-table td:last-child {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.app-info-table td code {
  display: inline-block;
  max-width: 100%;
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: normal;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: #f3f4f6;
  color: #1976d2;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.45;
  vertical-align: baseline;
}

/* Store-badge flex layout — inner <div> needs min-width:0 to allow
   long content (URLs) to shrink below its intrinsic width.
   Without this, .store-status code overflows the .store-badge box. */
.store-badge > div {
  min-width: 0;
  flex: 1 1 auto;
}

.store-badge .store-status {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.store-badge .store-status code {
  display: inline-block;
  max-width: 100%;
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: normal;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.55);
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.45;
}

/* Mobile-specific tightening (under 600px) */
@media (max-width: 600px) {
  .app-info-table {
    font-size: 0.88rem;
  }
  .app-info-table td:first-child {
    width: 38%;
    padding-right: 0.6rem;
  }
  .app-info-table td code,
  .store-badge .store-status code {
    font-size: 0.72rem;
    padding: 1px 4px;
  }
}
