/* リアルタイム監視ダッシュボードスタイル */

.monitoring-dashboard {
    padding: 20px;
    background: #f8fafc;
    min-height: 100vh;
}

/* ダッシュボードヘッダー */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

.dashboard-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auto-refresh-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
}

/* システム概要セクション */
.overview-section {
    margin-bottom: 30px;
}

.overview-section h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.overview-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.card-content {
    padding: 20px;
}

/* ヘルスインジケーター */
.health-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6b7280;
    transition: background-color 0.3s ease;
}

.status-dot.healthy {
    background: #10b981;
}

.status-dot.warning {
    background: #f59e0b;
}

.status-dot.critical {
    background: #ef4444;
}

.status-text {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
}

/* メトリクス表示 */
.health-metrics,
.performance-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric .label {
    font-size: 14px;
    color: #6b7280;
}

.metric .value {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

/* アラートカウント */
.alert-count {
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

.alert-count.zero {
    background: #6b7280;
}

/* 詳細メトリクスセクション */
.metrics-section {
    margin-bottom: 30px;
}

.metrics-section h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.metric-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.time-range-selector select {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

/* オペレーションテーブル */
.operations-table-container {
    overflow-x: auto;
}

.operations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.operations-table th {
    background: #f9fafb;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.operations-table td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.operations-table tbody tr:hover {
    background: #f9fafb;
}

.operations-table .loading,
.operations-table .no-data {
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

/* データベースセクション */
.database-section {
    margin-bottom: 30px;
}

.database-section h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.database-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.database-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* アラートセクション */
.alerts-section {
    margin-bottom: 30px;
}

.alerts-section h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.alerts-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.alert-item:last-child {
    border-bottom: none;
}

.alert-severity {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.alert-severity.warning {
    background: #f59e0b;
}

.alert-severity.critical {
    background: #ef4444;
}

.alert-severity.info {
    background: #3b82f6;
}

.alert-message {
    flex: 1;
    font-size: 14px;
    color: #374151;
}

.alert-time {
    font-size: 12px;
    color: #6b7280;
}

/* ボタンスタイル */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-outline {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    background: #f9fafb;
    color: #374151;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #374151;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #e5e7eb;
}

/* ユーティリティクラス */
.loading {
    color: #6b7280;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.no-data,
.no-alerts {
    color: #6b7280;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.text-muted {
    color: #6b7280;
    font-size: 14px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .monitoring-dashboard {
        padding: 10px;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .dashboard-controls {
        justify-content: space-between;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }

    .database-grid {
        grid-template-columns: 1fr;
    }

    .operations-table-container {
        font-size: 12px;
    }

    .operations-table th,
    .operations-table td {
        padding: 8px;
    }
}

/* チャートコンテナ */
.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

/* アニメーション */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.updating {
    animation: pulse 1s infinite;
}

/* ステータス色 */
.status-connected {
    color: #10b981;
}

.status-failed {
    color: #ef4444;
}

.status-unknown {
    color: #6b7280;
}

/* パフォーマンス指標の色分け */
.performance-good {
    color: #10b981;
}

.performance-warning {
    color: #f59e0b;
}

.performance-critical {
    color: #ef4444;
}