/**
 * 画像エラーハンドリング用スタイル
 */

/* フォールバック表示用のコンテナ */
.image-error-fallback {
    position: relative;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

/* フォールバック表示の内容 */
.image-fallback-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    width: 100%;
    height: 100%;
}

/* フォールバックアイコン */
.fallback-icon {
    width: 48px;
    height: 48px;
    color: #94a3b8;
    margin-bottom: 12px;
    opacity: 0.6;
}

.fallback-icon svg {
    width: 100%;
    height: 100%;
}

/* フォールバックメッセージ */
.fallback-message {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

/* 再読み込みボタン */
.fallback-retry-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.fallback-retry-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.fallback-retry-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* 画像読み込み中の表示 */
img[src] {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    min-height: 100px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .image-error-fallback {
        min-height: 120px;
    }
    
    .fallback-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 10px;
    }
    
    .fallback-message {
        font-size: 12px;
        margin-bottom: 12px;
    }
    
    .fallback-retry-btn {
        padding: 7px 14px;
        font-size: 12px;
    }
}

@media (max-width: 520px) {
    .image-error-fallback {
        min-height: 100px;
    }
    
    .image-fallback-content {
        padding: 16px;
    }
    
    .fallback-icon {
        width: 36px;
        height: 36px;
        margin-bottom: 8px;
    }
    
    .fallback-message {
        font-size: 11px;
        margin-bottom: 10px;
    }
    
    .fallback-retry-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* ローディングアニメーション（オプション） */
@keyframes imagePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

img[loading="lazy"]:not([src*="?"]) {
    animation: imagePulse 1.5s ease-in-out infinite;
}

img[loading="lazy"].loaded {
    animation: none;
}
