/* =========================
   Widget (300px想定)
   ========================= */

.dvtv-gpu-widget {
  width: 100%;
  border-radius: 10px;
  background: #f3f6fb;
  border: 1px solid #e2e8f0;
  padding: 10px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Meiryo", sans-serif;
}

.dvtv-gpu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.dvtv-gpu-title {
  font-weight: 700;
  font-size: 14px;
  color: #111827;
}

.dvtv-gpu-updated {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  padding-top: 2px;
}

.dvtv-gpu-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dvtv-gpu-loading {
  font-size: 13px;
  color: #374151;
  padding: 8px;
}

.dvtv-gpu-error {
  font-size: 13px;
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px;
}

/* 写真のようなカード */
.dvtv-gpu-card {
  display: flex;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  overflow: hidden;
}

.dvtv-gpu-bar {
  width: 6px;
  flex: 0 0 6px;
}

.dvtv-gpu-bar-red { background: #ef4444; }
.dvtv-gpu-bar-green { background: #22c55e; }
.dvtv-gpu-bar-blue { background: #3b82f6; }

.dvtv-gpu-card-inner {
  flex: 1;
  padding: 10px 10px;
}

.dvtv-gpu-card-title {
  font-weight: 700;
  font-size: 15px;
  color: #111827;
  margin-bottom: 6px;
}

.dvtv-gpu-card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #111827;
  font-size: 13px;
}

.dvtv-gpu-metric {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 3px 8px;
  line-height: 1.2;
}

/* 温度90度以上で赤点滅 */
.dvtv-gpu-temp-high {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
  animation: dvtv-blink-red 0.8s ease-in-out infinite;
}

@keyframes dvtv-blink-red {
  0%, 100% { background: #fee2e2; }
  50% { background: #ef4444; color: #ffffff; }
}

.dvtv-gpu-foot {
  margin-top: 8px;
  font-size: 12px;
  color: #6b7280;
}

.dvtv-gpu-status {
  display: inline-block;
}

/* =========================
   Settings UI (Frontend)
   ========================= */

.dvtv-gpu-settings {
  width: 100%;
  max-width: 680px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Meiryo", sans-serif;
}

.dvtv-gpu-settings-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}

.dvtv-gpu-settings-title {
  font-weight: 800;
  font-size: 16px;
  color: #111827;
  margin-bottom: 12px;
}

.dvtv-gpu-settings-row {
  margin-bottom: 12px;
}

.dvtv-gpu-settings-label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  color: #111827;
  margin-bottom: 6px;
}

.dvtv-gpu-settings-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  outline: none;
}

.dvtv-gpu-settings-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96,165,250,0.25);
}

.dvtv-gpu-settings-hint {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.dvtv-gpu-settings-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.dvtv-gpu-btn {
  border: 1px solid #d1d5db;
  background: #f9fafb;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dvtv-gpu-btn:hover {
  background: #f3f4f6;
}

.dvtv-gpu-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dvtv-gpu-btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.dvtv-gpu-btn-primary:hover {
  background: #1d4ed8;
}

.dvtv-gpu-settings-msg {
  font-size: 13px;
}

.dvtv-gpu-settings-msg.ok { color: #065f46; }
.dvtv-gpu-settings-msg.ng { color: #b91c1c; }

.dvtv-gpu-settings-deny {
  padding: 10px;
  border: 1px solid #fecaca;
  background: #fee2e2;
  color: #7f1d1d;
  border-radius: 10px;
}

/* =========================
   Restart Buttons
   ========================= */

.dvtv-gpu-restart-card {
  border-color: #fbbf24;
  background: #fffbeb;
}

.dvtv-gpu-restart-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.dvtv-gpu-btn-restart {
  flex: 1;
  min-width: 150px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  border-radius: 10px;
}

.dvtv-gpu-btn-restart small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 2px;
}

/* 全スタック再起動 - 警告色 */
.dvtv-gpu-btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #b45309;
  color: #fff;
}

.dvtv-gpu-btn-warning:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
}

/* GPU0再起動 - 危険色（よく使う） */
.dvtv-gpu-btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: #b91c1c;
  color: #fff;
}

.dvtv-gpu-btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* 再起動ステータス表示 */
.dvtv-gpu-restart-status {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  min-height: 20px;
}

.dvtv-gpu-restart-status:empty {
  display: none;
}

.dvtv-gpu-restart-status.info {
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  color: #0369a1;
}

.dvtv-gpu-restart-status.success {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
}

.dvtv-gpu-restart-status.error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

.dvtv-gpu-restart-status.warning {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
}
