/* ================= VIEW ALL PAGE ================= */

/* Breadcrumb */
.breadcrumb {
  padding: 12px 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}
.breadcrumb-links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto;
}
.breadcrumb-link { color: #007bff; text-decoration: none; font-size: 0.9rem; }
.breadcrumb-link:hover { text-decoration: underline; }
.breadcrumb-separator { color: #777; font-size: 0.9rem; }
.breadcrumb-current { color: #555; font-size: 0.9rem; }

/* Page Header */
.page-header {
  padding: 25px 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
}
.page-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}
.page-subtitle {
  font-size: 1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.4;
}

/* Layout with sidebar */
.view-all-layout {
  display: flex;
  gap: 16px;
  margin: 10px;
  max-width: 100%;
  flex: 1;
}

.view-all-main {
  flex: 1;
  min-width: 0;
  background: #ffffff;
  padding: 15px;
  border-radius: 8px;
}

.view-all-sidebar {
  width: 320px;
  background: #ffffff;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  flex-shrink: 0;
  align-self: flex-start;
  position: sticky;
  top: 80px;
}

/* Section header inside main */
.section-header-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid #007bff;
}
.section-header-inline svg { color: #007bff; flex-shrink: 0; }
.section-header-inline h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
}
.count-badge {
  background: #eef1f4;
  color: #5f6368;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  margin-left: auto;
}

/* ================= VERTICAL APP LIST ================= */
.apps-list {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e9ecef;
}

.app-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
  position: relative;
}
.app-row:last-child { border-bottom: none; }
.app-row:hover { background: #f8f9fb; }
.app-row:active { background: #eef1f4; }

.app-row-number {
  width: 28px;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  color: #8a94a6;
  text-align: center;
}
.app-row:nth-child(1) .app-row-number { color: #f5a623; }
.app-row:nth-child(2) .app-row-number { color: #9aa5b1; }
.app-row:nth-child(3) .app-row-number { color: #cd7f32; }

.app-row-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  background: #eef1f4;
}

.app-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-row-name {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6c757d;
}

.app-row-version {
  font-size: 12px;
  color: #007bff;
  font-weight: 500;
  white-space: nowrap;
}
.app-row-version::after {
  content: "•";
  margin-left: 8px;
  color: #cbd2d9;
}

.app-row-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #24cd77;
  flex-shrink: 0;
}
.app-row-stat svg {
  width: 13px;
  height: 13px;
  fill: #24cd77;
}

/* Shimmer for list */
.apps-list.loading .app-row { pointer-events: none; }

.app-row.loading .app-row-number,
.app-row.loading .app-row-icon,
.app-row.loading .app-row-name,
.app-row.loading .app-row-version {
  background: linear-gradient(90deg, #e5e7eb 25%, #f1f5f9 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  color: transparent;
  border-radius: 6px;
}
.app-row.loading .app-row-number { width: 20px; height: 14px; }
.app-row.loading .app-row-name { height: 14px; width: 70%; }
.app-row.loading .app-row-version { height: 12px; width: 60px; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Empty state */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: #6c757d;
  font-style: italic;
  background: #f8f9fa;
  border-radius: 12px;
  border: 2px dashed #dee2e6;
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
  width: 100%;
}

/* Infinite scroll sentinel */
.scroll-sentinel {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.scroll-sentinel.active { opacity: 1; }
.scroll-sentinel.exhausted { opacity: 0; }
.scroll-sentinel::after {
  content: "";
  width: 28px;
  height: 28px;
  border: 3px solid #e5e7eb;
  border-top-color: #007bff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= MOBILE ================= */
@media (max-width: 768px) {
  .view-all-layout {
    flex-direction: column;
    gap: 0;
    margin: 0;
  }
  .view-all-main {
    padding: 0;
    border-radius: 0;
  }
  .view-all-sidebar { display: none; }

  .apps-list { border-radius: 0; border-left: none; border-right: none; }

  .app-row { padding: 10px 12px; gap: 10px; }
  .app-row-number { width: 22px; font-size: 14px; }
  .app-row-icon { width: 46px; height: 46px; border-radius: 12px; }
  .app-row-name { font-size: 13px; }
  .app-row-meta { font-size: 11px; }
  .app-row-version { font-size: 11px; }
  .app-row-stat { font-size: 11px; }

  .section-header-inline { margin: 15px 15px 12px; }
  .section-header-inline h1 { font-size: 1.2rem; }
  .page-title { font-size: 1.5rem; }
  .page-subtitle { font-size: 0.9rem; }
  .page-header { padding: 20px 12px; }
  .breadcrumb { padding: 10px 12px; }
  .breadcrumb-link, .breadcrumb-separator, .breadcrumb-current { font-size: 0.85rem; }
}

@media (max-width: 360px) {
  .app-row-icon { width: 40px; height: 40px; border-radius: 10px; }
  .app-row-name { font-size: 12px; }
  .app-row-version { font-size: 10px; }
}