/**
 * 標準エラーモーダルスタイル v2
 * Phase 3 Step 1: UX重視の統合エラー表示システム
 * 
 * 特徴:
 * - 既存UIとの統合（白ベースの統一感）
 * - 優先度別カラーリング
 * - カウントダウン機能付きUI
 * - モバイルレスポンシブ対応
 */

/* エラーモーダル基本構造 */
.standard-error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

/* 背景オーバーレイ */
.error-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* モーダルコンテンツ */
.error-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

/* 優先度別ボーダーカラー */
.error-modal-content[data-priority="high"] {
    border-top: 4px solid #dc2626; /* 赤 */
}

.error-modal-content[data-priority="medium"] {
    border-top: 4px solid #f59e0b; /* 黄色 */
}

.error-modal-content[data-priority="low"] {
    border-top: 4px solid #3b82f6; /* 青 */
}

/* エラーヘッダー */
.error-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.error-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}

.error-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.error-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

/* エラーボディ */
.error-body {
    padding: 8px 24px 24px;
}

.error-message {
    font-size: 16px;
    color: #374151;
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.error-suggestion {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
    background: #f9fafb;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid #e5e7eb;
}

/* カウントダウンコンテナ */
.countdown-container {
    margin: 16px 0;
    padding: 16px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 8px;
    border: 1px solid #f59e0b;
}

.countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: #92400e;
}

.countdown-value {
    font-size: 18px;
    font-weight: 700;
    color: #b45309;
    margin: 0 4px;
    min-width: 30px;
    text-align: center;
}

/* アクションボタンエリア */
.error-actions {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* エラーボタンスタイル */
.error-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.error-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* プライマリボタン */
.error-btn-primary {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.error-btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.error-btn-primary:disabled {
    background: #9ca3af;
    border-color: #9ca3af;
}

/* セカンダリボタン */
.error-btn-secondary {
    background: white;
    color: #6b7280;
    border-color: #d1d5db;
}

.error-btn-secondary:hover:not(:disabled) {
    background: #f9fafb;
    color: #374151;
    border-color: #9ca3af;
}

/* モバイル対応 */
@media (max-width: 480px) {
    .error-modal-content {
        min-width: 320px;
        max-width: 90vw;
        margin: 20px;
    }
    
    .error-header {
        padding: 16px 20px 12px;
    }
    
    .error-body {
        padding: 8px 20px 20px;
    }
    
    .error-actions {
        padding: 12px 20px 20px;
        flex-direction: column-reverse;
    }
    
    .error-btn {
        width: 100%;
        justify-content: center;
    }
    
    .error-title {
        font-size: 16px;
    }
    
    .error-message {
        font-size: 15px;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 優先度別アイコンカラー調整 */
.error-modal-content[data-priority="high"] .error-title {
    color: #dc2626;
}

.error-modal-content[data-priority="medium"] .error-title {
    color: #f59e0b;
}

.error-modal-content[data-priority="low"] .error-title {
    color: #3b82f6;
}

/* フォーカス時のアクセシビリティ */
.error-btn:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.error-close:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ハイコントラストモード対応 */
@media (prefers-contrast: high) {
    .error-modal-content {
        border: 2px solid #000;
    }
    
    .error-btn {
        border-width: 2px;
    }
    
    .error-suggestion {
        border-left-width: 4px;
    }
}

/* アニメーション無効設定対応 */
@media (prefers-reduced-motion: reduce) {
    .standard-error-modal,
    .error-modal-content {
        animation: none;
    }
    
    .error-btn,
    .error-close {
        transition: none;
    }
}

/* ダークモード対応（将来の拡張用） */
@media (prefers-color-scheme: dark) {
    .error-modal-content {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .error-header {
        border-bottom-color: #374151;
    }
    
    .error-title {
        color: #f9fafb;
    }
    
    .error-message {
        color: #d1d5db;
    }
    
    .error-suggestion {
        background: #374151;
        color: #9ca3af;
        border-left-color: #6b7280;
    }
    
    .error-btn-secondary {
        background: #374151;
        color: #d1d5db;
        border-color: #6b7280;
    }
    
    .error-btn-secondary:hover:not(:disabled) {
        background: #4b5563;
        color: #f3f4f6;
    }
}