/* Tool-specific overrides */
.format-select {
    width: auto;
    min-width: 140px;
    padding: 6px 36px 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: var(--card-bg);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.format-select:hover {
    border-color: var(--input-border);
    background-color: var(--dropzone-bg);
}

.format-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(94, 92, 230, 0.1);
}

.quality-control {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-color);
    border-radius: 12px;
    display: none;
}

.quality-control.visible {
    display: block;
}

.quality-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quality-value {
    font-weight: 600;
    color: var(--accent-color);
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--input-border);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.gallery {
    margin-top: 24px;
    display: none;
    width: 100%;
}

.gallery.visible {
    display: block;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.gallery-stats {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.gallery-stats strong {
    color: var(--text-main);
    font-weight: 600;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 4px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: var(--dropzone-bg);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.file-item:hover {
    border-color: var(--input-border);
    background: var(--card-bg);
}

.file-preview {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: var(--tag-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    font-size: 1.5rem;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.file-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.file-details {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-status {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.file-status.queued {
    background: var(--tag-bg);
    color: var(--text-secondary);
}

.file-status.converting {
    background: #FFF4DB;
    color: #B45309;
}

.file-status.done {
    background: #E1F8E8;
    color: #059669;
}

.file-status.error {
    background: #FEE2E2;
    color: #DC2626;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 1rem;
    color: var(--text-secondary);
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.icon-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Mobile Layout Optimizations */
@media (max-width: 640px) {
    .app-shell {
        padding-left: 0;
        padding-right: 0;
        padding-top: 20px;
    }

    .tool-container {
        padding: 0;
        max-width: 100% !important;
    }

    .card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 20px !important;
    }

    .file-item {
        flex-direction: row;
        gap: 12px;
        padding: 12px;
        align-items: center;
    }

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

    .file-name {
        /* Ensure truncation happens */
        max-width: 100%;
    }

    .guide-wrapper {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-top: 24px;
    }

    .hero-compact {
        margin-bottom: 4px !important;
        padding: 0;
    }

    .hero-compact h1 {
        font-size: 1.75rem;
        margin-bottom: 6px;
        padding: 0 16px;
    }

    .hero-compact p {
        font-size: 0.9rem;
        line-height: 1.4;
        padding: 0 16px;
    }
}