/* PDF Converter Tools - Shared Styles */

.tool-controls {
    margin: 24px 0;
    padding: 24px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #374151;
    border-radius: 12px;
}

.control-group {
    margin-bottom: 20px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 8px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.quality-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #ef4444, #f59e0b, #10b981);
    outline: none;
    -webkit-appearance: none;
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.quality-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.quality-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.quality-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.slider-value {
    font-size: 16px;
    font-weight: 600;
    color: #10b981;
    min-width: 50px;
    text-align: right;
}

.format-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #374151;
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.format-select:hover {
    border-color: #4b5563;
}

.format-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.preview-header {
    margin: 24px 0 16px;
    text-align: center;
}

.preview-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #e5e7eb;
}

.size-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    padding: 20px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #374151;
    border-radius: 12px;
    flex-wrap: wrap;
}

.size-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.size-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.size-value {
    font-size: 18px;
    font-weight: 700;
    color: #e5e7eb;
}

.size-arrow {
    font-size: 24px;
    color: #64748b;
}

.size-savings {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
}

.savings-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #6ee7b7;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.savings-value {
    font-size: 20px;
    font-weight: 700;
    color: #10b981;
}

.preview-container {
    margin: 24px 0;
    padding: 24px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 12px;
    border: 1px solid #1f2937;
}

.preview-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.preview-image-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#preview-section {
    display: none;
}

#preview-section.active {
    display: block;
}

/* PDF preview grid (for multiple pages) */
.pdf-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px;
}

.pdf-page-item {
    position: relative;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
}

.pdf-page-item img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pdf-page-number {
    margin-top: 8px;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
}

/* Light theme support */
[data-theme="light"] .preview-image-wrapper img {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .pdf-page-item img {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-actions {
    display: flex;
    gap: 12px;
    margin: 24px 0;
}

.btn-download {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: rgba(30, 41, 59, 0.8);
    color: #e5e7eb;
    border: 1px solid #374151;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(51, 65, 85, 0.8);
    border-color: #4b5563;
}

/* PDF Merge - File List with Drag & Drop */
.pdf-file-list {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 8px;
    border: 2px dashed rgba(75, 85, 99, 0.5);
}

.pdf-file-list-title {
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: #818cf8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pdf-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pdf-file-item {
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: grab;
    transition: all 0.2s;
    border: 2px solid rgba(55, 65, 81, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.pdf-file-item:active {
    cursor: grabbing;
}

.pdf-file-item.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

.pdf-file-item.drag-over {
    border-color: #818cf8;
    background: rgba(79, 70, 229, 0.2);
    transform: translateX(10px);
}

.pdf-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    color: #9ca3af;
}

.pdf-file-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    background: #4f46e5;
    color: white;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.4);
}

.pdf-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
    color: #e5e7eb;
    font-weight: 500;
}

.pdf-file-size {
    font-size: 0.85rem;
    color: #9ca3af;
    white-space: nowrap;
    font-weight: 500;
}

.pdf-remove-btn {
    padding: 0.4rem 0.75rem;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    font-weight: 600;
}

.pdf-remove-btn:hover {
    background: #b91c1c;
}

/* Light Theme */
[data-theme="light"] .pdf-file-list {
    background: #f8f9fa;
    border-color: #dee2e6;
}

[data-theme="light"] .pdf-file-list-title {
    color: #4f46e5;
}

[data-theme="light"] .pdf-file-item {
    background: white;
    border-color: #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .pdf-file-item.drag-over {
    border-color: #4f46e5;
    background: rgba(79, 70, 229, 0.05);
}

[data-theme="light"] .pdf-drag-handle {
    color: #6c757d;
}

[data-theme="light"] .pdf-file-number {
    background: #4f46e5;
}

[data-theme="light"] .pdf-file-name {
    color: #1a1a1a;
}

[data-theme="light"] .pdf-file-size {
    color: #6c757d;
}

[data-theme="light"] .pdf-remove-btn {
    background: #dc3545;
}

[data-theme="light"] .pdf-remove-btn:hover {
    background: #c82333;
}

@media (max-width: 768px) {
    .size-comparison {
        flex-direction: column;
        gap: 12px;
    }

    .size-arrow {
        transform: rotate(90deg);
    }

    .preview-actions {
        flex-direction: column;
    }

    .pdf-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .pdf-file-item {
        gap: 0.5rem;
    }

    .pdf-file-name {
        font-size: 0.85rem;
    }

    .pdf-file-size {
        font-size: 0.75rem;
    }
}
