/* ===== APPS PAGE ===== */
#page-apps { 
  padding: 0 0 0;
  padding-top: calc(var(--nav-height) + 16px);
  display: flex; flex-direction: column; align-items: center; overflow: hidden; 
}

.apps-page-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 8px 12px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(24,24,24,0.24);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  z-index: 1;
}

.apps-page-header .page-search-wrap {
  flex: 1;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 6px 8px;
  width: auto;
  border-radius: 0;
}

.page-action-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-active);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-secondary);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.page-action-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: rgba(255,255,255,0.22);
}

.page-search-wrap {
  display: flex; align-items: center; gap: 10px;
  background: rgba(24,24,24,0.24);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-xl);
  padding: 10px 18px; width: min(100%, 420px);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.page-search-wrap:focus-within {
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}
.apps-page-header .page-search-wrap svg { color: rgba(255,255,255,0.82); }
.apps-page-header .page-search-wrap input {
  color: rgba(255,255,255,0.95);
  font-weight: 500;
}
.apps-page-header .page-search-wrap input::placeholder { color: rgba(255,255,255,0.6); }

/* Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 20px 16px;
  width: min(100%, 1600px);
  max-width: 1600px;
  position: relative;
  z-index: 1;
}

/* Card */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  animation: appCardIn 0.35s ease forwards;
  opacity: 0;
  position: relative;
}
@keyframes appCardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.app-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
}
.app-card:active { transform: translateY(-1px) scale(0.99); }

/* Banner area */
.app-banner {
  width: 100%;
  height: 72px;
  background: var(--bg-active);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.app-banner-bg {
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background-size: 180px 180px;
  background-position: center;
  filter: blur(14px) saturate(1.2);
  transform: scale(1.15);
  transition: opacity var(--transition);
}
.app-card:hover .app-banner-bg { opacity: 0.14; }

.app-icon-large {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  flex-shrink: 0;
}
.app-icon-large img { width: 28px; height: 28px; object-fit: contain; }
.app-icon-large .app-icon-placeholder {
  font-size: 20px; font-weight: 800; color: var(--text-secondary);
}

/* Card body */
.app-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.app-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.app-open-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 9px;
  border-radius: 20px;
  background: var(--bg-active);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.app-card:hover .app-open-btn {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.app-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Pagination */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 8px 0 24px;
  position: relative;
  z-index: 1;
}
.page-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border);
  transition: all var(--transition);
}
.page-btn:hover { color: var(--text-primary); border-color: var(--border-hover); background: var(--bg-hover); }
.page-btn.active { color: var(--bg-primary); background: var(--text-primary); border-color: var(--text-primary); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.page-search-wrap svg { color: var(--text-muted); flex-shrink: 0; }
.page-search-wrap input { flex: 1; font-size: 13px; }
