/* PDF Compressor Tool Styles */
.tool-container {
    padding: 120px 0 60px;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.tool-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.tool-title {
    font-size: var(--text-4xl);
    font-weight: 700;
    margin: var(--space-lg) 0 var(--space-md);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-description {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Upload Section */
.upload-section {
    margin-bottom: var(--space-2xl);
}

.file-dropzone {
    border: 3px dashed var(--border-medium);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    max-width: 500px;
    margin: 0 auto;
}

.file-dropzone:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.file-dropzone.dragover {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: white;
}

.file-dropzone.dragover .dropzone-icon,
.file-dropzone.dragover h3,
.file-dropzone.dragover p,
.file-dropzone.dragover .file-types {
    color: white;
}

.dropzone-content .dropzone-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.dropzone-content h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.dropzone-content p {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.file-types {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* File Info Section */
.file-info-section {
    margin-bottom: var(--space-2xl);
}

.file-info-section h3 {
    text-align: center;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.file-info-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 0 auto;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--text-primary);
}

.detail-value {
    color: var(--text-secondary);
}

#compressionPotential {
    font-weight: 600;
    color: var(--accent-primary);
}

/* Options Section */
.options-section {
    margin-bottom: var(--space-2xl);
}

.options-panel {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    max-width: 700px;
    margin: 0 auto;
}

.options-panel h3 {
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
    text-align: center;
}

.option-group {
    margin-bottom: var(--space-xl);
}

.option-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

/* Compression Levels */
.compression-levels {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.level-option {
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.level-option:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.level-option.selected {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.level-check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-medium);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.3s ease;
}

.level-check:after {
    content: "✓";
    color: white;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.level-option.selected .level-check {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.level-option.selected .level-check:after {
    opacity: 1;
}

.level-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.level-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--text-lg);
}

.level-desc {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.4;
}

.level-savings {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--accent-primary);
}

/* Advanced Options */
.advanced-options {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.option-label.checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 0;
}

.option-label.checkbox input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkmark:after {
    content: "✓";
    color: white;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.option-label.checkbox input[type="checkbox"]:checked + .checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.option-label.checkbox input[type="checkbox"]:checked + .checkmark:after {
    opacity: 1;
}

.option-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: var(--space-xs);
    margin-left: 28px;
}

/* Target Size Slider */
.size-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    margin: var(--space-md) 0;
    -webkit-appearance: none;
}

.size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.size-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.size-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

#targetSizeValue {
    font-weight: 600;
    color: var(--accent-primary);
    margin-left: var(--space-sm);
}

/* Results Preview */
.results-preview {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.results-preview h4 {
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    text-align: center;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.result-estimate {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    text-align: center;
}

.estimate-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.estimate-value {
    font-weight: 600;
    color: var(--text-primary);
}

.estimate-value.savings {
    color: var(--accent-primary);
}

.action-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--border-light);
    border-color: var(--accent-primary);
}

/* Processing Section */
.processing-section {
    margin-bottom: var(--space-2xl);
}

.processing-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.processing-header {
    margin-bottom: var(--space-xl);
}

.loading-spinner.large {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-lg);
}

.processing-header h3 {
    color: var(--text-primary);
    margin-bottom: 0;
}

.processing-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

#progressText {
    font-weight: 500;
}

#progressPercent {
    font-weight: 600;
    color: var(--accent-primary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.processing-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    transition: all 0.3s ease;
}

.step.active {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--accent-primary);
}

.step.completed {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #10b981;
}

.step-icon {
    font-size: 1.2rem;
}

.step-text {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

.step.active .step-text {
    color: var(--accent-primary);
    font-weight: 600;
}

.step.completed .step-text {
    color: #10b981;
    font-weight: 600;
}

/* Results Section */
.results-section {
    margin-bottom: var(--space-2xl);
}

.results-section h3 {
    text-align: center;
    margin-bottom: var(--space-xl);
    color: var(--text-primary);
}

.results-container {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    max-width: 800px;
    margin: 0 auto;
}

.comparison-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xl);
    margin-bottom: var(--space-xl);
}

.comparison-original,
.comparison-compressed {
    flex: 1;
    text-align: center;
    padding: var(--space-lg);
}

.comparison-original h4,
.comparison-compressed h4 {
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.file-preview {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-preview.compressed {
    border: 2px solid var(--accent-primary);
}

.pdf-icon {
    font-size: 3rem;
    color: var(--accent-primary);
}

.compression-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--accent-primary);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
}

.file-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--border-light);
}

.stat:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 500;
    color: var(--text-primary);
}

.stat-value {
    color: var(--text-secondary);
    font-weight: 600;
}

.stat.savings .stat-value {
    color: var(--accent-primary);
}

.comparison-arrow {
    font-size: 2rem;
    color: var(--accent-primary);
    font-weight: bold;
}

.results-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

/* Benefits Section */
.benefits-section {
    margin-bottom: var(--space-2xl);
}

.benefits-section h3 {
    text-align: center;
    margin-bottom: var(--space-xl);
    color: var(--text-primary);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.benefit-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    transition: all 0.3s ease;
}

.benefit-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.benefit-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.benefit-card h4 {
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    font-size: var(--text-lg);
}

.benefit-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Use Cases */
.use-cases {
    margin-bottom: var(--space-2xl);
}

.use-cases h3 {
    text-align: center;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.use-case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.use-case-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.use-case-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.case-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.case-text {
    color: var(--text-primary);
    font-weight: 500;
}

/* Instructions */
.tool-instructions {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--border-light);
}

.tool-instructions h3 {
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.tool-instructions ol {
    margin-left: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.tool-instructions li {
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

.privacy-note {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    color: var(--text-primary);
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .comparison-card {
        flex-direction: column;
        gap: var(--space-lg);
    }
    
    .comparison-arrow {
        transform: rotate(90deg);
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .processing-steps {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons,
    .results-actions {
        flex-direction: column;
    }
    
    .benefits-grid,
    .use-case-grid {
        grid-template-columns: 1fr;
    }
    
    .advanced-options {
        grid-template-columns: 1fr;
    }
}

.hidden {
    display: none !important;
}
.performance-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    margin-top: var(--space-md);
    display: inline-block;
}

.advanced-options {
    margin: var(--space-lg) 0;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    cursor: pointer;
}

.checkbox-option input[type="checkbox"] {
    margin: 0;
}

.checkbox-option span {
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.compression-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

.detail-card {
    background: var(--bg-secondary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
}

.detail-card strong {
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.detail-card span {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}