/* ==========================================================================
   App Gallery Styles — Story 4.7
   Horizontal scrollable gallery of app tiles at drill levels
   ========================================================================== */

/* ── Container ──────────────────────────────────────────────────────── */

.app-gallery-container {
  margin-bottom: 1rem;
  padding: 0.75rem 0;
}

/* ── Header ─────────────────────────────────────────────────────────── */

.app-gallery-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
  padding: 0 0.25rem;
}

.app-gallery-header-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #e0e0f0);
}

.app-gallery-header-metric {
  font-size: 0.75rem;
  color: var(--text-secondary, #a0a0c0);
}

.app-gallery-active-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-left: auto;
  padding: 0.25rem 0.625rem;
  background: var(--accent-primary-alpha, rgba(234, 179, 8, 0.15));
  border-radius: 12px;
  font-size: 0.75rem;
}

.app-gallery-filter-text {
  color: var(--accent-primary, #facc15);
  font-weight: 500;
}

.app-gallery-clear-btn {
  color: var(--text-secondary, #a0a0c0);
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1;
  transition: color 0.15s;
}

.app-gallery-clear-btn:hover {
  color: var(--status-error, #f87171);
}

/* ── Scroll Wrapper ─────────────────────────────────────────────────── */

.app-gallery-scroll-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.app-gallery-scroll-area {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 0.5rem 0.25rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  flex: 1;
}

.app-gallery-scroll-area::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* ── Scroll Buttons ─────────────────────────────────────────────────── */

.app-gallery-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-primary, #2a2a3e);
  background: var(--bg-secondary, #1e1e2e);
  color: var(--text-secondary, #a0a0c0);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
  opacity: 0.7;
  padding: 0;
  font-family: var(--font-body, 'Roboto', sans-serif);
}

.app-gallery-scroll-btn:hover {
  background: var(--bg-tertiary, #2a2a3e);
  color: var(--text-primary, #e0e0f0);
  border-color: var(--accent-primary, #facc15);
  opacity: 1;
}

.app-gallery-scroll-btn--left {
  left: -6px;
}

.app-gallery-scroll-btn--right {
  right: -6px;
}

/* ── Tile ───────────────────────────────────────────────────────────── */

.app-gallery-tile {
  flex: 0 0 auto;
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 0.5rem;
  background: var(--bg-secondary, #1e1e2e);
  border: 1px solid var(--border-primary, #2a2a3e);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  user-select: none;
}

.app-gallery-tile:hover {
  background: var(--bg-tertiary, #2a2a3e);
  border-color: var(--accent-primary-alpha, rgba(234, 179, 8, 0.4));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.app-gallery-tile--selected {
  border-color: var(--accent-primary, #facc15);
  background: var(--accent-primary-alpha, rgba(234, 179, 8, 0.12));
  box-shadow: 0 0 0 2px var(--accent-primary-alpha, rgba(234, 179, 8, 0.25));
}

.app-gallery-tile--selected:hover {
  border-color: var(--accent-primary, #facc15);
}

/* ── Tile Icon ──────────────────────────────────────────────────────── */

.app-gallery-tile-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-gallery-tile-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.app-gallery-tile-icon-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,
    var(--accent-primary, #facc15) 0%,
    var(--accent-secondary, #a78bfa) 100%
  );
  color: white;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

/* ── Tile Name ──────────────────────────────────────────────────────── */

.app-gallery-tile-name {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-primary, #e0e0f0);
  text-align: center;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

/* ── Tile Metric ────────────────────────────────────────────────────── */

.app-gallery-tile-metric {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent-primary, #facc15);
  font-variant-numeric: tabular-nums;
}
