/* Batch page specific styles - extends common.css */

/* Input section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Drop zone - inline layout */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--paper);
    padding: 1rem;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--accent);
    background: #faf8f5;
}

.upload-icon {
    font-size: 1rem;
}
.upload-icon-lucide {
    width: 18px;
    height: 18px;
    stroke: var(--muted);
    stroke-width: 1.5;
}

.upload-text {
    font-size: 0.9rem;
    color: var(--muted);
}

.images-count {
    font-size: 0.8rem;
    color: var(--muted);
    margin-left: auto;
}

.images-count:empty {
    display: none;
}

#file-input {
    display: none;
}

/* Action buttons - responsive grid */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
}

.action-tile.tile-wide {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .action-buttons {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .action-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    .action-tile.tile-wide {
        grid-column: span 2;
    }
}

.action-tile {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: linear-gradient(180deg, #fdfcfa 0%, #f8f5f0 100%);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0.5rem 0.75rem;
    text-align: center;
    box-shadow:
        0 1px 2px rgba(61, 46, 36, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.action-tile:hover {
    background: linear-gradient(180deg, #fff 0%, #faf7f2 100%);
    border-color: #c9bfb0;
    box-shadow:
        0 3px 8px rgba(61, 46, 36, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.action-tile:active {
    transform: translateY(0);
    box-shadow:
        0 1px 2px rgba(61, 46, 36, 0.08),
        inset 0 1px 3px rgba(61, 46, 36, 0.06);
    background: linear-gradient(180deg, #f5f2ed 0%, #f8f5f0 100%);
}

.action-tile:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.tile-icon {
    width: 16px;
    height: 16px;
    stroke: var(--ink);
    stroke-width: 1.5;
}

.tile-label {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Tooltip */
.action-tile[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--paper);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.4;
    width: max-content;
    max-width: 240px;
    text-align: left;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(61, 46, 36, 0.15);
    pointer-events: none;
    animation: tooltipFade 0.2s ease;
}

.action-tile[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--ink);
    z-index: 100;
    pointer-events: none;
    animation: tooltipFade 0.2s ease;
}

@keyframes tooltipFade {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Uploaded images grid */
.uploaded-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 1rem;
}

.uploaded-image {
    position: relative;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--border);
}

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

.uploaded-image .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(255, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uploaded-image .remove-btn:hover {
    background: #ff4444;
}

/* Results section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.results-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover {
    background: #faf8f5;
}

.result-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--paper);
    border: 1px solid var(--border);
}

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

.result-filename {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.result-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--muted);
}

.result-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-size {
    background: #fce7f3;
    color: #9f1239;
}

.badge-format {
    background: #ccfbf1;
    color: #115e59;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
}

.result-item.processing {
    opacity: 0.6;
}

.result-item.processing .result-thumbnail {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
