/* ==========================================================================
   portal.css — Public Portal Page Specific Styles
   ========================================================================== */

.portal-body {
  max-width: var(--container-max);
  margin-inline: auto;
  padding: var(--space-6);
}

/* ---------- Portal Header ---------- */
.portal-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.portal-greeting h1 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-green-deep);
  margin-bottom: var(--space-1);
}
.portal-greeting .portal-date {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ---------- Stats Row ---------- */
.portal-stats {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.portal-stat {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-width: 120px;
}
.portal-stat-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 21px;
  flex-shrink: 0;
}
.portal-stat-icon.total   { background: var(--color-green-light); color: var(--color-green-deep); }
.portal-stat-icon.online  { background: var(--color-success-bg);  color: var(--color-success); }
.portal-stat-icon.offline { background: var(--color-surface-2);   color: var(--color-text-muted); }
.portal-stat-icon.cat     { background: var(--color-gold-light);  color: var(--color-gold-dark); }

.portal-stat-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.portal-stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
}
.portal-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ---------- Quick Access ---------- */
.quick-access {
  margin-bottom: var(--space-8);
}
.section-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.section-label .count {
  color: var(--color-green-main);
}

/* ---------- App Section ---------- */
.app-section {
  margin-bottom: var(--space-8);
}
.app-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: var(--space-5);
}

/* Hidden by filter */
.app-card.is-hidden {
  display: none;
}

/* Highlight when jumped from quick access */
.app-card.is-highlighted {
  animation: highlight-flash 1.6s ease;
  border-color: var(--color-gold-main);
  border-width: 2px;
  position: relative;
  z-index: 2;
}
.app-card.is-highlighted::before {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid var(--color-gold-main);
  border-radius: calc(var(--radius-lg) + 4px);
  pointer-events: none;
  animation: highlight-ring 1.6s ease;
}
@keyframes highlight-ring {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.04); }
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--color-text-muted);
}
.empty-state i {
  font-size: 56px;
  opacity: .4;
  margin-bottom: var(--space-3);
}
.empty-state p {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

/* ---------- Load More ---------- */
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: var(--space-6);
}

/* ---------- Portal Footer ---------- */
.portal-footer {
  text-align: center;
  padding: var(--space-8) var(--space-6);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-8);
}

@media (max-width: 860px) {
  .portal-body { padding: var(--space-5) var(--space-4); }
}

@media (max-width: 640px) {
  .portal-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
  }
  .portal-stats {
    width: 100%;
  }
  .portal-stat {
    flex: 1 1 calc(50% - var(--space-3));
    min-width: calc(50% - var(--space-3));
    padding: var(--space-3);
  }
  .app-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

@media (max-width: 400px) {
  .portal-stat {
    flex-basis: 100%;
    min-width: 100%;
  }
  .portal-greeting h1 { font-size: var(--text-xl); }
}

/* Cegah horizontal scroll di seluruh halaman */
html, body { max-width: 100%; overflow-x: hidden; }
