/* リセットとベース設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダー */
header {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* ステータス概要 */
.status-overview {
    margin-bottom: 2rem;
}

.overall-status {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.status-indicator {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.status-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.status-up .status-indicator::after {
    background: linear-gradient(45deg, #4CAF50, #66BB6A);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
}

.status-down .status-indicator::after {
    background: linear-gradient(45deg, #f44336, #ef5350);
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.4);
}

.status-degraded .status-indicator::after {
    background: linear-gradient(45deg, #ff9800, #ffb74d);
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.4);
}

.status-unknown .status-indicator::after {
    background: linear-gradient(45deg, #9e9e9e, #bdbdbd);
    box-shadow: 0 0 20px rgba(158, 158, 158, 0.4);
}

.status-text h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.status-text p {
    color: #666;
    font-size: 0.95rem;
}

/* セクション */
section {
    margin-bottom: 2rem;
}

section h3 {
    color: white;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* グリッドレイアウト */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

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

/* カード */
.service-card, .info-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
}

.service-card {
    border-left: 4px solid #ddd;
    position: relative;
}

.service-card.up {
    border-left-color: #4CAF50;
}

.service-card.down {
    border-left-color: #f44336;
}

.service-card.degraded {
    border-left-color: #ff9800;
}

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

.service-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.service-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.service-status.up {
    background: #e8f5e8;
    color: #2e7d32;
}

.service-status.down {
    background: #ffebee;
    color: #c62828;
}

.service-status.degraded {
    background: #fff3e0;
    color: #ef6c00;
}

.service-details {
    color: #666;
    font-size: 0.9rem;
}

.response-time {
    margin-top: 0.5rem;
    font-weight: 500;
}

.response-time.fast {
    color: #4CAF50;
}

.response-time.medium {
    color: #ff9800;
}

.response-time.slow {
    color: #f44336;
}


/* 情報カード */
.info-card {
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
}

.info-card h4 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.info-card p {
    color: #666;
    font-weight: 500;
}

/* フッター */
footer {
    text-align: center;
    color: white;
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.refresh-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* ローディングオーバーレイ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.loading-overlay p {
    color: white;
    font-size: 1.1rem;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    position: relative;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover {
    color: #000;
}

/* エラー表示 */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid #f44336;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .overall-status {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .service-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    footer {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* アニメーション */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* パルス効果 */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
    100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}
