/* Image Processing Styles */

/* Section Visibility */
.upload-section, .preview-section, .result-section {
    display: none;
}

.upload-section.active, .preview-section.active, .result-section.active {
    display: block;
}

/* Process Steps Enhancement */
.process-steps .step.active {
    color: #28a745;
}

.process-steps .step.active .step-icon {
    background: #28a745;
    color: white;
}

/* Preview Section */
.preview-section {
    padding: 2rem 0;
    background: #f8f9fa;
}

.preview-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    margin-top: 2rem;
}

.preview-area {
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.canvas-container {
    position: relative;
    display: inline-block;
}

#preview-canvas, #result-canvas {
    max-width: 100%;
    height: auto;
    border: 2px solid #007bff;
    border-radius: 8px;
}

.dimension-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.dimension-label {
    position: absolute;
    background: #007bff;
    color: white;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 3px;
}

.dimension-label.top {
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
}

.dimension-label.left {
    left: -35px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
}

.dimension-label.bottom {
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
}

.preview-watermark {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    font-size: 14px;
    border-radius: 4px;
}

/* Adjustment Panel */
.adjustment-panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.adjustment-panel h3 {
    margin: 0 0 1.5rem 0;
    color: #333;
    font-size: 1.2rem;
}

.adjustment-control {
    margin-bottom: 1.5rem;
}

.adjustment-control label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #28a745;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #28a745;
    cursor: pointer;
    border: none;
}

.flip-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    background: #007bff;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.flip-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.flip-btn.active {
    background: #28a745;
    color: white;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

/* Confirmation Checklist */
.confirmation-checklist {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.confirmation-checklist h4 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
}

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

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 3px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #28a745;
    border-color: #28a745;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.confirm-btn {
    width: 100%;
    padding: 0.75rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-btn:disabled {
    background: #6c757d;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 0.8;
}

.confirm-btn:not(:disabled):hover {
    background: #218838;
}

/* Result Section */
.result-section {
    padding: 2rem 0;
    background: #f8f9fa;
}

.processing-queue {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.timer {
    font-size: 2rem;
    font-weight: bold;
    color: #28a745;
    margin: 1rem 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: #28a745;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 60%;
}

.queue-message {
    color: #666;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.result-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.digital-photo, .photo-sheet {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.digital-photo h3, .photo-sheet h3 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.1rem;
}

.photo-preview, .sheet-preview {
    margin-bottom: 1rem;
    text-align: center;
}

#sheet-canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.paper-size-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #218838;
}

/* Responsive Design */
@media (max-width: 768px) {
    .preview-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .result-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .adjustment-panel {
        order: -1;
    }
    
    .dimension-label {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .dimension-label.top {
        top: -20px;
    }
    
    .dimension-label.left {
        left: -30px;
    }
    
    .dimension-label.bottom {
        bottom: -20px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #28a745;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Canvas Styling */
canvas {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

