/* フロー図スタイル */
.flow-diagram {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.flow-step-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flow-step-card {
    display: block;
    width: 100%;
    max-width: 600px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.flow-step-card:hover {
    border-color: #f97316;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
    transform: translateY(-2px);
}

.flow-step-card.completed {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.flow-step-card.incomplete {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-number {
    width: 2.5rem;
    height: 2.5rem;
    background: #f97316;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.flow-step-card.completed .step-number {
    background: #10b981;
}

.step-info {
    flex: 1;
}

.step-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
}

.step-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-text {
    font-size: 0.875rem;
    color: #6b7280;
    white-space: nowrap;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #f97316;
    transition: width 0.3s ease;
}

.flow-step-card.completed .progress-fill {
    background: #10b981;
}

.completion-badge {
    color: #10b981;
    flex-shrink: 0;
}

.step-thumbnails {
    margin-top: 0.75rem;
}

.no-images {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    color: #9ca3af;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px dashed #d1d5db;
    min-height: 60px;
    max-height: 60px;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.thumbnail {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail.more-count {
    background: #6b7280;
    color: white;
    font-size: 0.75rem;
}

.flow-arrow {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0;
    color: #9ca3af;
}

.flow-connector {
    width: 2px;
    height: 20px;
    background: #d1d5db;
    margin: 0.5rem auto;
    position: relative;
}

.flow-connector::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid #d1d5db;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .flow-step-card {
        padding: 1rem;
    }

    .step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .step-progress {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .progress-bar {
        width: 100%;
    }

    .thumbnail-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* カードホバー効果 */
.card-hover {
    transition: all 0.3s ease;
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* サイドバーフロー */
.flow-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flow-sidebar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flow-sidebar-link {
    display: block;
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    background: white;
}

.flow-sidebar-link:hover {
    border-color: #f97316;
    background: #fef7ed;
}

.flow-sidebar-link.current {
    border-color: #f97316;
    background: #fef7ed;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.15);
}

.flow-sidebar-link.completed {
    border-color: #10b981;
    background: #f0fdf4;
}

.flow-sidebar-link.incomplete {
    border-color: #f59e0b;
    background: #fef3c7;
}

.flow-sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.flow-sidebar-number {
    width: 1.5rem;
    height: 1.5rem;
    background: #f97316;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
}

.flow-sidebar-link.completed .flow-sidebar-number {
    background: #10b981;
}

.flow-sidebar-info {
    flex: 1;
    min-width: 0;
}

.flow-sidebar-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flow-sidebar-count {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
}

.flow-sidebar-badge {
    color: #10b981;
    flex-shrink: 0;
}

.flow-sidebar-progress {
    width: 100%;
}

.flow-sidebar-progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.flow-sidebar-progress-fill {
    height: 100%;
    background: #f97316;
    transition: width 0.3s ease;
}

.flow-sidebar-link.completed .flow-sidebar-progress-fill {
    background: #10b981;
}

.flow-sidebar-arrow {
    display: flex;
    justify-content: center;
    margin: 0.25rem 0;
    color: #9ca3af;
}

.flow-sidebar-connector {
    width: 1px;
    height: 12px;
    background: #d1d5db;
    margin: 0.25rem auto;
    position: relative;
}

.flow-sidebar-connector::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 4px solid #d1d5db;
}

/* 分岐工程のインデントスタイル */
.flow-sidebar-branch-item {
    margin-left: 1.5rem;
    position: relative;
}

.flow-sidebar-branch-item::before {
    display: none;
}

.flow-sidebar-branch-item::after {
    display: none;
}

/* 分岐工程の番号スタイル */
.flow-sidebar-branch-item .flow-sidebar-number {
    background: #f97316;
    border-radius: 4px;
    font-size: 0.7rem;
    width: 1.8rem;
    height: 1.2rem;
}

/* サイドバーのスクロールスタイル */
.flow-sidebar {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f9fafb;
}

.flow-sidebar::-webkit-scrollbar {
    width: 6px;
}

.flow-sidebar::-webkit-scrollbar-track {
    background: #f9fafb;
    border-radius: 3px;
}

.flow-sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.flow-sidebar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
