/* ======================================================
   MadCo App Store styles — cards, toolbar, detail modal
   Theme-aware (uses variables from css/style.css)
   ====================================================== */

/* ---------- STORE HERO ---------- */
.store-hero { padding: 140px 0 40px; text-align: center; position: relative; overflow: hidden; }
.store-hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -1px; margin: 0 0 12px 0; }
[dir="rtl"] .store-hero h1 { letter-spacing: 0; }
.store-hero h1 .gradient { background: linear-gradient(135deg, #6366F1, #C084FC); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
[data-theme="light"] .store-hero h1 .gradient { background: linear-gradient(135deg, #4F46E5, #9333EA); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.store-desc { color: var(--text-muted); font-size: 17px; line-height: 1.7; max-width: 560px; margin: 0 auto 24px auto; }
.store-count { display: inline-flex; align-items: center; gap: 6px; background: var(--card-soft); border: 1px solid var(--border-strong); padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-faint); }
.store-count #storeCount { color: var(--accent-text); font-weight: 800; }

/* ---------- TOOLBAR ---------- */
.store-toolbar { padding: 8px 0 40px; }
.store-toolbar .container { display: flex; gap: 14px; flex-wrap: wrap; }
.store-search {
  flex: 1; min-width: 240px; background: var(--card); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px 18px;
  font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.2s;
}
.store-search:focus { border-color: var(--accent-text); }
.store-search::placeholder { color: var(--text-dim); }
.store-category {
  background: var(--card); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 12px 14px; font-size: 14px; font-family: inherit;
  cursor: pointer; outline: none;
}
.store-category option { background: var(--card); color: var(--text); }
.admin-link {
  margin-left: auto; background: var(--card); border: 1px solid var(--border-strong);
  color: var(--text-muted); border-radius: 12px; padding: 12px 16px; font-size: 13px;
  font-weight: 600; text-decoration: none; transition: border-color 0.2s, color 0.2s;
}
.admin-link:hover { border-color: var(--accent-text); color: var(--text); }

/* ---------- APP GRID ---------- */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; padding-bottom: 100px; }
.app-card {
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 18px;
  padding: 24px; display: flex; flex-direction: column; gap: 16px; cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.app-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--border-brand); }
.app-card-top { display: flex; gap: 14px; align-items: center; }
.app-icon { width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0; }
.app-card-head { min-width: 0; }
.app-name { font-size: 18px; font-weight: 700; margin: 0 0 2px 0; }
.app-category { font-size: 12px; font-weight: 600; color: var(--accent-text); }
.app-short { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin: 0; }
.app-meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-faint); }
.app-rating { color: #F59E0B; font-weight: 700; }
.app-card-actions { display: flex; gap: 10px; margin-top: auto; }
.app-btn { padding: 10px 18px; font-size: 13px; }
.app-btn-details { cursor: pointer; font-family: inherit; }

/* ---------- EMPTY / ERROR ---------- */
.store-message { text-align: center; padding: 60px 0 100px; color: var(--text-faint); font-size: 15px; }

/* ---------- DETAIL MODAL ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 20px; overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 20px;
  max-width: 760px; width: 100%; padding: 28px; position: relative; box-shadow: var(--shadow-card);
}
.modal-close {
  position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 10px;
  background: var(--card-soft); border: 1px solid var(--border-strong); color: var(--text);
  font-size: 14px; cursor: pointer; line-height: 1;
}
[dir="rtl"] .modal-close { right: auto; left: 16px; }
.modal-head { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.modal-icon { width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0; }
.modal-name { font-size: 24px; font-weight: 800; margin: 0 0 4px 0; }
.modal-cat { font-size: 13px; color: var(--accent-text); font-weight: 600; }
.modal-rating { margin-left: auto; font-size: 14px; color: #F59E0B; font-weight: 700; }
[dir="rtl"] .modal-rating { margin-left: 0; margin-right: auto; }

.modal-gallery { position: relative; border-radius: 16px; overflow: hidden; background: var(--bg-soft); margin-bottom: 12px; }
.modal-photo { width: 100%; display: block; aspect-ratio: 9 / 16; object-fit: cover; }
.gallery-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.92); color: #0F172A; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
[dir="rtl"] .gallery-prev { left: auto; right: 12px; }
[dir="rtl"] .gallery-next { right: auto; left: 12px; }
.photo-thumbs { display: flex; gap: 10px; margin-bottom: 24px; }
.photo-thumb {
  width: 64px; height: 64px; border-radius: 10px; object-fit: cover; cursor: pointer;
  border: 2px solid transparent; opacity: 0.7; transition: border-color 0.2s, opacity 0.2s;
}
.photo-thumb:hover { opacity: 1; }
.photo-thumb.active { border-color: var(--accent-text); opacity: 1; }

.modal-desc { color: var(--text-muted); font-size: 15px; line-height: 1.8; margin-bottom: 24px; }
.modal-section-title {
  font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text); margin: 0 0 12px 0;
}
[dir="rtl"] .modal-section-title { letter-spacing: 0; }
.feature-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.feature-chip { background: var(--card-soft); border: 1px solid var(--border-strong); border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 600; }
.modal-info {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px; margin-bottom: 24px;
}
.info-item .label { font-size: 11px; color: var(--text-faint); letter-spacing: 0.5px; text-transform: uppercase; }
.info-item .value { font-size: 14px; font-weight: 600; margin-top: 2px; word-break: break-all; }
.modal-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-play {
  background: #16A34A; color: #fff; padding: 14px 28px; border-radius: 10px; font-weight: 600;
  font-size: 15px; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: transform 0.2s, background 0.2s;
}
.btn-play:hover { transform: translateY(-2px); background: #15803D; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .store-hero { padding-top: 110px; }
  .store-hero h1 { font-size: 32px; }
  .modal { padding: 20px; }
  .modal-info { grid-template-columns: 1fr; }
  .modal-photo { aspect-ratio: 4 / 5; }
}