/* PDF Tools Styles */

.pdf-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.pdf-header {
    text-align: center;
    margin-bottom: 2rem;
}

.pdf-header h1 {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.pdf-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Tool Selection Tabs */
.tool-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.tool-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.tool-tab svg {
    width: 28px;
    height: 28px;
}

.tool-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tool-tab.active {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.2) 0%, rgba(124, 58, 237, 0.2) 100%);
    border-color: var(--primary);
    color: var(--primary);
}

/* Tool Panels */
.tool-panel {
    display: none;
}

.tool-panel.active {
    display: block;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    background: var(--surface-color);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: rgba(88, 101, 242, 0.1);
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-content h3 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

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

/* Files Section */
.files-section {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: none;
}

.files-section.show {
    display: block;
}

.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.files-header h3 {
    color: var(--text-light);
    font-size: 1.1rem;
}

.drag-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--dark-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    cursor: grab;
    transition: all 0.3s ease;
}

.file-item:hover {
    border-color: var(--primary);
}

.file-item.sortable-ghost {
    opacity: 0.5;
}

.file-item.sortable-chosen {
    border-color: var(--primary);
    background: rgba(88, 101, 242, 0.1);
}

.file-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.7rem;
}

.file-preview {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface-color);
}

.file-info {
    flex: 1;
}

.file-name {
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.file-size {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.file-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.file-remove:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.file-remove svg {
    width: 20px;
    height: 20px;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.clear-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.clear-btn:hover {
    border-color: var(--error);
    color: var(--error);
}

.process-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
}

.process-btn svg {
    width: 18px;
    height: 18px;
}

/* Split Options */
.split-options,
.compress-options {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: none;
}

.split-options.show,
.compress-options.show {
    display: block;
}

.pdf-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--dark-bg);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.pdf-name {
    color: var(--text-light);
    font-weight: 500;
}

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

.split-mode h4,
.quality-options h4 {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.mode-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--text-light);
    font-size: 0.95rem;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.radio-label input:checked + .radio-custom {
    border-color: var(--primary);
}

.radio-label input:checked + .radio-custom::after {
    opacity: 1;
}

.range-inputs,
.custom-input {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-left: 2rem;
}

.range-inputs input,
.custom-input input {
    padding: 0.75rem;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    width: 100px;
}

.custom-input input {
    width: 200px;
}

.range-inputs span {
    color: var(--text-muted);
}

/* Quality Buttons */
.quality-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.quality-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--dark-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quality-btn:hover {
    border-color: var(--primary);
}

.quality-btn.active {
    border-color: var(--primary);
    background: rgba(88, 101, 242, 0.1);
}

.quality-level {
    color: var(--text-light);
    font-weight: 600;
}

.quality-desc {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Images Options */
.images-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--dark-bg);
    border-radius: 12px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-group label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.option-group select {
    padding: 0.75rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
}

.option-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Result Section */
.result-section {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    text-align: center;
    display: none;
}

.result-section.show {
    display: block;
}

.result-info {
    margin-bottom: 1.5rem;
}

.result-icon {
    width: 64px;
    height: 64px;
    color: var(--success);
    margin-bottom: 1rem;
}

.result-info h3 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.result-info p {
    color: var(--text-muted);
}

.result-files {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.result-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--dark-bg);
    border-radius: 12px;
}

.result-file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.download-all-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.download-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(88, 101, 242, 0.4);
}

.download-all-btn svg {
    width: 20px;
    height: 20px;
}

/* Progress Overlay */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.progress-overlay.show {
    display: flex;
}

.progress-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-content h3 {
    margin-bottom: 0.5rem;
}

.progress-content p {
    color: var(--text-muted);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--success);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1001;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .pdf-container {
        padding: 1rem;
    }

    .pdf-header h1 {
        font-size: 2rem;
    }

    .tool-selection {
        grid-template-columns: repeat(2, 1fr);
    }

    .upload-zone {
        padding: 2rem;
    }

    .quality-buttons {
        grid-template-columns: 1fr;
    }

    .action-bar {
        flex-direction: column;
    }

    .action-bar button {
        width: 100%;
    }

    .range-inputs,
    .custom-input {
        flex-wrap: wrap;
        padding-left: 0;
    }

    .custom-input input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .pdf-container {
        padding: 0.75rem;
    }

    .pdf-header h1 {
        font-size: 1.75rem;
    }

    .pdf-header p {
        font-size: 0.95rem;
    }

    .tool-selection {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .tool-tab {
        padding: 1rem 0.5rem;
        font-size: 0.8rem;
    }

    .tool-tab svg {
        width: 22px;
        height: 22px;
    }

    .upload-zone {
        padding: 1.5rem 1rem;
    }

    .upload-icon {
        width: 48px;
        height: 48px;
    }

    .files-section,
    .split-options,
    .compress-options,
    .result-section {
        padding: 1rem;
        border-radius: 12px;
    }

    .files-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .file-item {
        padding: 0.75rem;
    }

    .file-icon {
        width: 35px;
        height: 35px;
        font-size: 0.6rem;
    }

    .pdf-info {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .result-file {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .result-file-info {
        flex-wrap: wrap;
    }

    .quality-buttons {
        gap: 0.5rem;
    }

    .quality-btn {
        padding: 0.75rem 0.5rem;
    }
}
