/* 九州国際学院ブランドカラー */
:root {
  --primary-color: #2c5282;
  --success-color: #38a169;
  --warning-color: #dd6b20;
  --danger-color: #e53e3e;
  --bg-color: #f7fafc;
  --card-bg: #ffffff;
  --text-primary: #2d3748;
  --text-secondary: #718096;
  --border-color: #e2e8f0;
}

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

body {
  font-family: 'Segoe UI', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  background: var(--bg-color);
  padding: 0;
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 100%;
  margin: 0;
  padding: 16px;
}

header {
  display: none;
}

.subtitle {
  display: none;
}

.status-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.5rem;
}

.status-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-icon.operational {
  background: #10b981;
}

.status-icon.degraded {
  background: #f59e0b;
}

.status-icon.down {
  background: #ef4444;
}

.status-icon::after {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
}

.status-icon.operational::after {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10b981;
  font-size: 16px;
  font-weight: bold;
}

.status-icon.degraded::after {
  content: '!';
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
  font-size: 16px;
  font-weight: bold;
}

.status-icon.down::after {
  content: '×';
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
  font-size: 16px;
  font-weight: bold;
}

.status-text h2 {
  font-size: 1.1rem;
  margin-bottom: 4px;
  font-weight: 600;
}

.status-text p {
  color: #6b7280;
  font-size: 0.85rem;
}

.monitors-section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.monitors-section h3 {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

#monitors-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.monitor-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-top: 4px solid var(--border-color);
  transition: all 0.3s ease;
  text-align: center;
}

.monitor-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.monitor-card.operational {
  border-top-color: var(--success-color);
}

.monitor-card.down {
  border-top-color: var(--danger-color);
}

.monitor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.monitor-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.monitor-info {
  width: 100%;
}

.monitor-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.monitor-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.monitor-stats span {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.monitor-stats span strong {
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 700;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.stat .value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.monitor-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.up,
.status-badge.operational {
  background: #c6f6d5;
  color: #22543d;
}

.status-badge.down {
  background: #fed7d7;
  color: #742a2a;
}

.status-badge.paused,
.status-badge.loading {
  background: #e2e8f0;
  color: #4a5568;
}

.spinner {
  border: 2px solid var(--border-color);
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.monitor-card.loading {
  justify-content: center;
  gap: 12px;
}

/* グラフセクション */
.charts-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.chart-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.chart-card canvas {
  max-height: 200px;
}

/* バックアップセクション */
.backup-section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.backup-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.backup-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.backup-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 1rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.backup-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.backup-card.daily {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.backup-card.weekly {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.backup-card.monthly {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.backup-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.backup-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.backup-time {
  font-size: 0.75rem;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}

.backup-next {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.95;
}

footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-top: 1rem;
}

footer p {
  margin: 4px 0;
}

.last-update {
  font-weight: 500;
}

.info {
  font-size: 0.7rem;
  opacity: 0.8;
}

/* アラート詳細表示用のスタイル */
.alert-details {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
}

.alert-details.error {
  background-color: #fee;
  border-left: 4px solid #dc2626;
}

.alert-details.warning {
  background-color: #fef3c7;
  border-left: 4px solid #f59e0b;
}

.alert-details ul {
  margin: 0.5rem 0 0 1.5rem;
  padding: 0;
}

.alert-details li {
  margin: 0.25rem 0;
}

.internal-services {
  margin-top: 2rem;
}

@media (max-width: 640px) {
  header h1 {
    font-size: 1.5rem;
  }

  .status-card {
    padding: 20px;
  }

  .status-indicator {
    flex-direction: column;
    text-align: center;
  }

  #monitors-list {
    grid-template-columns: 1fr;
  }

  .monitor-card {
    text-align: center;
  }

  .charts-section {
    grid-template-columns: 1fr;
  }

  .backup-cards {
    grid-template-columns: 1fr;
  }

  .backup-card {
    flex-direction: column;
    text-align: center;
  }
}
