@import "../common.css";

/* IMG2PDF Specific Styles (Based on PDF2IMG) */

/* Thumbnail Grid */
.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    padding: 16px;
    background: #f8fbff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow-y: auto;
    max-height: 400px;
    margin-top: 16px;
}

.thumb-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.thumb-img-box {
    background: #fff;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    aspect-ratio: 1/1.414; /* A4 ratio approx default */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb-item:hover .thumb-img-box {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.thumb-item.selected .thumb-img-box {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(43, 111, 255, 0.2);
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thumb-page {
    text-align: center;
    font-size: 0.75rem;
    color: var(--ink-500);
    font-weight: 500;
}

.thumb-item.selected .thumb-page {
    color: var(--blue-700);
    font-weight: 700;
}

/* Settings Panel */
.settings-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-700);
    display: flex;
    justify-content: space-between;
}

.form-control {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--ink-900);
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(43, 111, 255, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Empty State Override */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--ink-500);
    gap: 12px;
    padding: 40px;
    text-align: center;
}

.empty-icon {
    width: 48px;
    height: 48px;
    color: var(--blue-200);
}

/* Dropzone (reused) */
.dropzone {
    border: 2px dashed var(--blue-200);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    background: var(--blue-50);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.dropzone:hover {
    border-color: var(--blue-500);
    background: #eef6ff;
}

.dropzone.is-dragover {
    border-color: var(--blue-600);
    background: #e9f2ff;
    box-shadow: 0 0 0 4px rgba(43, 111, 255, 0.15);
}

.dropzone-icon {
    color: var(--blue-600);
    background: #e8f1ff;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
}

.dropzone-text strong {
    font-size: 1rem;
    display: block;
}

.dropzone-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.dropzone-action {
    background: #ffffff;
    border: 1px solid var(--blue-200);
    color: var(--blue-700);
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.dropzone-action:hover {
    background: var(--blue-50);
}

/* List */
.list-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-text {
    font-size: 0.8rem;
    color: var(--ink-500);
}

.file-list {
    flex: 1;
    list-style: none;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fafcff;
}

.file-list-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.file-list-item:hover {
    background: var(--blue-50);
}

.file-list-item.active {
    background: var(--blue-50);
    border-left: 3px solid var(--blue-600);
}

.file-list-item:last-child {
    border-bottom: none;
}

.file-info {
    min-width: 0;
    flex: 1;
}

.file-path {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink-700);
}

.file-meta {
    font-size: 0.75rem;
    color: var(--ink-500);
}

/* Progress */
.progress-area {
    margin-bottom: 4px;
}

.progress-bar-bg {
    height: 6px;
    background: var(--blue-100);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3c7dff, #2b6fff);
    width: 0%;
    transition: width 0.2s ease;
}

.progress-info {
    font-size: 0.75rem;
    color: var(--ink-500);
    text-align: right;
    display: flex;
    justify-content: space-between;
}

/* Button Icon */
.btn-icon {
    background: var(--blue-50);
    color: var(--blue-600);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--blue-100);
    color: var(--blue-700);
}

/* Pill */
.pill {
    background: var(--blue-50);
    color: var(--blue-700);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pill-outline {
    background: #ffffff;
    border: 1px solid var(--blue-200);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
