/* ===================================
   障害対策システム用CSS
   =================================== */

/* ステータスドットの拡張 */
.status-dot.status-degraded {
    background-color: #ff9800;
    animation: pulse-orange 2s infinite;
}

.status-dot.status-offline {
    background-color: #f44336;
    animation: pulse-red 2s infinite;
}

.status-dot-mobile.status-degraded {
    background-color: #ff9800;
    animation: pulse-orange 2s infinite;
}

.status-dot-mobile.status-offline {
    background-color: #f44336;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-orange {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* サービス状態表示 */
.service-status {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    max-width: 200px;
    word-wrap: break-word;
}

.service-status.supabase-down {
    background: rgba(244, 67, 54, 0.9);
}

.service-status.cloudflare-down {
    background: rgba(255, 152, 0, 0.9);
}

.service-status.supabase-degraded {
    background: rgba(255, 152, 0, 0.9);
}

.service-status.cloudflare-degraded {
    background: rgba(255, 152, 0, 0.9);
}

/* オフラインモード表示 */
.offline-mode-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #f44336;
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    z-index: 1001;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* 障害ログ表示 */
.disaster-log-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
}

.disaster-log-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    padding: 20px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
}

.disaster-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.disaster-log-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.disaster-log-entry {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #f9f9f9;
}

.disaster-log-timestamp {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.disaster-log-event {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.disaster-log-details {
    font-size: 14px;
    color: #555;
    white-space: pre-wrap;
}

/* 復旧テストボタン */
.recovery-test-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 14px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
}

.recovery-test-btn:hover {
    background: #45a049;
}

.recovery-test-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .service-status {
        top: 5px;
        right: 5px;
        font-size: 11px;
        padding: 6px 10px;
        max-width: 150px;
    }
    
    .disaster-log-content {
        max-width: 95%;
        max-height: 90%;
        padding: 15px;
    }
    
    .recovery-test-btn {
        bottom: 10px;
        left: 10px;
        padding: 10px 16px;
        font-size: 12px;
    }
}

/* デバッグ情報表示 */
.debug-info {
    position: fixed;
    bottom: 60px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    max-width: 300px;
    word-wrap: break-word;
    display: none;
}

.debug-info.show {
    display: block;
}

.debug-info h4 {
    margin: 0 0 8px 0;
    color: #4CAF50;
}

.debug-info p {
    margin: 4px 0;
}

.debug-info .status-healthy {
    color: #4CAF50;
}

.debug-info .status-degraded {
    color: #ff9800;
}

.debug-info .status-down {
    color: #f44336;
}
