/* PDF変換ツール固有のスタイル */

/* CSS変数定義（共通CSSの変数を活用） */
:root {
    --preview-item-height: 200px;
    --preview-item-min-width: 200px;
    --remove-btn-size: 32px;
    --order-badge-size: 32px;
    --error-bg: #fed7d7;
    --error-color: #e53e3e;
}

/* プレビューセクション */
.preview-section {
    margin-bottom: var(--spacing-3xl);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.preview-header h2 {
    color: var(--text-secondary);
    font-size: 1.5em;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--preview-item-min-width), 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.preview-item {
    position: relative;
    border: 2px solid var(--border-lighter);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-white);
    transition: all var(--transition-normal);
    cursor: move;
}

.preview-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-preview);
    border-color: var(--primary-color);
}

.preview-item.dragging {
    opacity: 0.5;
}

.preview-item img {
    width: 100%;
    height: var(--preview-item-height);
    object-fit: cover;
    display: block;
}

.preview-info {
    padding: 12px;
    background: var(--bg-section);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.preview-name {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-size {
    color: var(--text-light);
    font-size: 0.8em;
}

.btn-remove {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: var(--remove-btn-size);
    height: var(--remove-btn-size);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-remove:hover {
    background: var(--error-bg);
    transform: scale(1.1);
}

.btn-remove svg {
    color: var(--error-color);
}

.preview-order {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    background: rgba(77, 208, 225, 0.95);
    color: var(--bg-white);
    width: var(--order-badge-size);
    height: var(--order-badge-size);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    width: 100%;
}

/* タブレット対応 */
@media (max-width: 768px) {
    .preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--spacing-lg);
    }
}

/* スマートフォン対応 */
@media (max-width: 480px) {
    .preview-grid {
        grid-template-columns: 1fr;
    }

    .preview-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
