/* PINECO Command Center — Common Styles */

:root {
  --bg: #0f1419;
  --bg-card: #1a1f29;
  --bg-hover: #232836;
  --bg-wall: #0b0f16;
  --border: #2a3040;
  --text: #e4e6ea;
  --text-dim: #8b95a7;
  --accent: #4ade80;
  --red: #f87171;
  --orange: #fb923c;
  --yellow: #fbbf24;
  --blue: #60a5fa;
  --purple: #a78bfa;
  --pink: #f472b6;
  --gray: #64748b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  zoom: var(--ui-zoom, 1.2);
}

body {
  font-family: -apple-system, 'Segoe UI', 'Pretendard', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* Shared header nav */
.pc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-wall);
  gap: 16px;
  flex-wrap: wrap;
}
.pc-header h1 {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.pc-header .pc-badge {
  background: #7f1d1d;
  color: #fca5a5;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 600;
}
.pc-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.pc-nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}
.pc-nav a:hover {
  color: var(--text);
  background: var(--bg-card);
}
.pc-nav a.active {
  background: var(--bg-card);
  color: var(--text);
  border-bottom: 2px solid var(--blue);
  border-radius: 5px 5px 0 0;
}
.pc-meta {
  color: var(--text-dim);
  font-size: 11px;
  display: flex;
  gap: 16px;
  white-space: nowrap;
}
.pc-meta strong { color: var(--accent); }

/* Status dot */
.pc-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 4px;
  animation: pc-pulse 2s ease-in-out infinite;
}
@keyframes pc-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Refresh button */
.pc-refresh-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.pc-refresh-btn:hover {
  border-color: var(--blue);
  color: var(--text);
}
.pc-refresh-btn.spinning { opacity: 0.5; pointer-events: none; }

/* Subtle card hover lift */
.card { transition: border-color 0.15s; }
.card:hover { border-color: #3a4054 !important; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-hover) 50%, var(--bg-card) 100%);
  background-size: 200% 100%;
  animation: pc-skeleton 1.5s linear infinite;
  border-radius: 4px;
}
@keyframes pc-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Polished scrollbars */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: #3a4054; }

/* Badge styles (shared) */
.pc-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  background: var(--bg-hover);
  color: var(--text-dim);
}
.pc-pill.pc-pill-ok { background: #14532d; color: #86efac; }
.pc-pill.pc-pill-warn { background: #78350f; color: #fbbf24; }
.pc-pill.pc-pill-err { background: #7f1d1d; color: #fca5a5; }

/* Pager buttons */
.ap-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  min-width: 22px;
  font-family: inherit;
  transition: all 0.15s;
}
.ap-btn:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--text);
}
.ap-btn.active {
  background: var(--blue);
  color: var(--bg-wall);
  border-color: var(--blue);
  font-weight: 600;
}
.ap-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Tooltip */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-wall);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  border: 1px solid var(--border);
  z-index: 50;
  pointer-events: none;
}

/* ── Global font/zoom sizer ───────────────── */
.font-sizer-global {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
  vertical-align: middle;
}
.font-sizer-global button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #ccc;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.3;
  transition: all 0.1s;
}
.font-sizer-global button:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.font-sizer-global span {
  font-size: 10px;
  color: var(--text-dim);
  min-width: 18px;
  text-align: center;
}

/* Mobile */
@media (max-width: 900px) {
  .pc-header {
    padding: 10px 14px;
    flex-direction: column;
    align-items: flex-start;
  }
  .pc-header h1 { font-size: 15px; }
  .pc-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .pc-meta {
    font-size: 10px;
    gap: 10px;
    flex-wrap: wrap;
  }
}
