/* アラート管理システムのスタイル */

.alert-management-container {
    padding: 20px;
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* アラート統計カード */
.alert-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.alert-stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #007bff;
    transition: transform 0.2s ease;
}

.alert-stat-card:hover {
    transform: translateY(-2px);
}

.alert-stat-card.warning {
    border-left-color: #ffc107;
}

.alert-stat-card.critical {
    border-left-color: #dc3545;
}

.alert-stat-card.emergency {
    border-left-color: #ff0000;
}

.alert-stat-card.escalated {
    border-left-color: #6f42c1;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.stat-icon {
    font-size: 24px;
    opacity: 0.7;
}

.stat-count {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.stat-label {
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* アラート管理コントロール */
.alert-controls {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-label {
    font-weight: 600;
    color: #333;
    min-width: 120px;
}

/* アクティブアラート表示 */
.active-alerts-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.alert-count-badge {
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
}

/* アラートアイテム */
.alert-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.alert-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.alert-item.alert-warning {
    border-left: 4px solid #ffc107;
}

.alert-item.alert-danger {
    border-left: 4px solid #dc3545;
}

.alert-item.alert-emergency {
    border-left: 4px solid #ff0000;
}

.alert-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-level {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-level i {
    font-size: 18px;
}

.level-text {
    font-weight: bold;
    font-size: 14px;
}

.alert-actions {
    display: flex;
    gap: 10px;
}

.alert-content {
    padding: 20px;
}

.alert-message {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.alert-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

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

.detail-item.escalation {
    background-color: #fff3cd;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ffeaa7;
}

.detail-item .label {
    font-weight: 600;
    color: #666;
}

.detail-item .value {
    color: #333;
    font-weight: 500;
}

/* アラートなし状態 */
.no-alerts {
    text-align: center;
    padding: 40px 20px;
}

.no-alerts .alert {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

/* タイプ別統計チャート */
.alert-type-chart {
    margin-top: 20px;
}

.chart-item {
    margin-bottom: 15px;
}

.chart-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    text-transform: capitalize;
}

.chart-bar {
    position: relative;
    background-color: #e9ecef;
    border-radius: 4px;
    height: 30px;
    overflow: hidden;
}

.chart-fill {
    background: linear-gradient(90deg, #007bff, #0056b3);
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.chart-value {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

/* テストアラート設定 */
.test-alert-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.test-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* 通知 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    min-width: 300px;
    max-width: 500px;
}

/* 自動更新トグル */
.auto-refresh-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #007bff;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .alert-management-container {
        padding: 10px;
    }
    
    .alert-stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .control-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .control-label {
        min-width: auto;
    }
    
    .alert-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .alert-details {
        grid-template-columns: 1fr;
    }
    
    .test-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .alert-management-container {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .alert-stat-card,
    .alert-controls,
    .active-alerts-section,
    .test-alert-section {
        background-color: #2d2d2d;
        color: #e0e0e0;
    }
    
    .alert-item {
        background-color: #2d2d2d;
        border-color: #444;
    }
    
    .alert-header {
        background-color: #3a3a3a;
    }
    
    .detail-item {
        border-bottom-color: #444;
    }
    
    .chart-bar {
        background-color: #444;
    }
}