/* more.css
 * Extracted from public/styles.css (Phase 0.3).
 * v1.0.42: loaded eagerly from index.html (was lazy-loaded — caused FOUC).
 */

#more-view {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

#app.more-mode #more-view {
  display: flex;
}

.more-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.more-stripe {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px;
  background: var(--accent-subtle);
  border-left: 3px solid var(--md-sys-color-primary);
  border-radius: var(--md-sys-shape-corner-md);
  color: var(--md-sys-color-on-surface);
}

.more-stripe-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line);
  font-weight: 600;
  letter-spacing: var(--md-sys-typescale-body-medium-tracking);
}

.more-stripe-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
  animation: morePulse 2s ease-in-out infinite;
}

.more-stripe-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* M3 assist chip */
.more-stripe-chip {
  font-family: var(--md-sys-typescale-font-family);
  font-size: var(--md-sys-typescale-label-large-size);
  line-height: var(--md-sys-typescale-label-large-line);
  font-weight: var(--md-sys-typescale-label-large-weight);
  letter-spacing: var(--md-sys-typescale-label-large-tracking);
  padding: 6px 16px;
  border-radius: var(--md-sys-shape-corner-sm);
  border: 1px solid var(--md-sys-color-outline);
  background: transparent;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  transition: background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 32px;
}

.more-stripe-chip:hover {
  background: var(--md-sys-color-surface-container-high);
}

@media (max-width: 480px), (pointer: coarse) {
  .more-stripe-chip { min-height: 48px; padding: 10px 16px; }
}

.more-section-label {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line);
  font-weight: 700;
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 10px;
}

.more-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* M3 card with state-layer overlay */
.more-tile {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-height: 140px;
  padding: 16px;
  background: var(--md-sys-color-surface-container);
  border: none;
  border-radius: var(--md-sys-shape-corner-md);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  box-shadow: var(--md-sys-elevation-1);
  overflow: hidden;
  transition: background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard),
              box-shadow var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
  -webkit-tap-highlight-color: transparent;
}

.more-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--md-sys-color-on-surface);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
  pointer-events: none;
  z-index: -1;
}

@media (hover: hover) {
  .more-tile:hover::after { opacity: var(--md-sys-state-hover-opacity); }
}

.more-tile:active::after { opacity: var(--md-sys-state-pressed-opacity); }

.more-tile-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.more-tile-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 8px;
  flex-shrink: 0;
  background: var(--accent-subtle);
  color: var(--md-sys-color-primary);
}

.more-tile-icon svg { width: 100%; height: 100%; }

/* Tile category color variants. Routed through M3 semantic tokens where
   they map cleanly. The legacy indigo (#6366f1) and purple (#a855f7) hex
   tints are kept as-is so existing tile categories continue to read --
   migrating tile category color taxonomy is a separate UX call. */
.more-tile--primary    .more-tile-icon { background: var(--accent-subtle); color: var(--md-sys-color-primary); }

.more-tile--secondary  .more-tile-icon { background: rgba(99, 102, 241, 0.12); color: #6366f1; }

.more-tile--tertiary   .more-tile-icon { background: rgba(168, 85, 247, 0.12); color: #a855f7; }

.more-tile--warning    .more-tile-icon { background: var(--md-sys-color-warning-bg); color: var(--md-sys-color-warning-fg); }

.more-tile--critical   .more-tile-icon { background: var(--md-sys-color-error-container); color: var(--md-sys-color-error); }

.more-tile--neutral    .more-tile-icon { background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container); }

.more-tile-label {
  flex: 1;
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line);
  font-weight: 600;
  letter-spacing: var(--md-sys-typescale-body-medium-tracking);
  color: var(--md-sys-color-on-surface);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.more-tile-badge {
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line);
  font-weight: 700;
  letter-spacing: var(--md-sys-typescale-label-small-tracking);
  padding: 2px 8px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-radius: var(--md-sys-shape-corner-full);
  margin-left: 6px;
}

.more-tile-metric {
  font-size: var(--md-sys-typescale-title-medium-size);
  line-height: var(--md-sys-typescale-title-medium-line);
  font-weight: var(--md-sys-typescale-title-medium-weight);
  letter-spacing: var(--md-sys-typescale-title-medium-tracking);
  color: var(--md-sys-color-on-surface);
  word-break: break-word;
}

.more-tile-metric--muted {
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 400;
}

.more-tile-metric--skeleton { display: flex; }

.more-skeleton {
  display: inline-block;
  width: 60%;
  height: 14px;
  border-radius: var(--md-sys-shape-corner-xs);
  background: linear-gradient(90deg, var(--md-sys-color-surface-container-high) 0%, var(--md-sys-color-outline-variant) 50%, var(--md-sys-color-surface-container-high) 100%);
  background-size: 200% 100%;
  animation: moreSkeleton 1.4s ease-in-out infinite;
}

.more-tile-pulse {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: morePulse 2s ease-in-out infinite;
}

.more-tile-pulse--ok       { background: var(--md-sys-color-success-fg); }

.more-tile-pulse--warning  { background: var(--md-sys-color-warning-fg); }

.more-tile-pulse--critical { background: var(--md-sys-color-error); }

@media (max-width: 600px) {
  .more-dashboard { gap: 18px; }
  .more-section-grid { grid-template-columns: 1fr; gap: 10px; }
  .more-tile { min-height: 120px; padding: 14px; }
  .more-tile-metric {
    font-size: var(--md-sys-typescale-body-large-size);
    line-height: var(--md-sys-typescale-body-large-line);
  }
}
