/* PNG to JPG Converter 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);
}

/* Preview Section */
.preview-section {
    margin-bottom: var(--space-2xl);
}

.preview-section h3 {
    text-align: center;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.preview-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xl);
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--border-light);
    max-width: 800px;
    margin: 0 auto;
}

.original-preview,
.result-preview-placeholder {
    flex: 1;
    text-align: center;
}

.original-preview h4,
.result-preview-placeholder h4 {
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.preview-image-container {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.preview-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.transparency-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    border-radius: var(--radius-md);
    opacity: 0.3;
    pointer-events: none;
}

.placeholder-icon {
    font-size: 3rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
}

.placeholder-text {
    color: var(--text-tertiary);
    font-style: italic;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.conversion-arrow {
    font-size: 2rem;
    color: var(--accent-primary);
    font-weight: bold;
}

/* 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: 600px;
    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);
}

/* Color Options */
.color-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.color-option {
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.color-option:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.color-option.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.color-check {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.color-option.selected .color-check {
    opacity: 1;
}

.color-option[data-color="transparent"] {
    background-image: 
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.custom-color {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.custom-color label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 100px;
}

#customColor {
    width: 50px;
    height: 40px;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    cursor: pointer;
}

#customColorHex {
    flex: 1;
    padding: var(--space-sm);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: monospace;
}

/* Quality Slider */
.quality-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    margin: var(--space-md) 0;
    -webkit-appearance: none;
}

.quality-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);
}

.quality-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);
}

.quality-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

#qualityValue {
    font-weight: 600;
    color: var(--accent-primary);
    margin-left: var(--space-sm);
}

/* Checkbox Options */
.option-label.checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-weight: 500;
}

.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;
}

.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;
}

.action-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-xl);
}

.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);
}

/* Results Section */
.results-section {
    margin-bottom: var(--space-2xl);
}

.results-section h3 {
    text-align: center;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.result-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: 600px;
    margin: 0 auto;
    display: flex;
    gap: var(--space-xl);
    align-items: center;
}

.result-preview {
    flex: 1;
}

.result-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-label {
    font-weight: 600;
    color: var(--text-primary);
}

.detail-value {
    color: var(--text-secondary);
}

.size-comparison {
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-align: center;
}

.size-comparison #sizeComparison {
    font-weight: 600;
    color: var(--text-primary);
}

.result-actions {
    display: flex;
    gap: var(--space-md);
}

/* Info Section */
.info-section {
    margin-bottom: var(--space-2xl);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.info-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
}

.info-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.info-card h4 {
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    font-size: var(--text-lg);
}

.info-card ul {
    text-align: left;
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-card li {
    margin-bottom: var(--space-sm);
}

/* 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 */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .preview-container {
        flex-direction: column;
        gap: var(--space-lg);
    }
    
    .conversion-arrow {
        transform: rotate(90deg);
    }
    
    .result-container {
        flex-direction: column;
        text-align: center;
    }
    
    .color-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .custom-color {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .action-buttons,
    .result-actions {
        flex-direction: column;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

.hidden {
    display: none !important;
}