/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f8f9fa;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(135deg, #004AAD, #007bff);
    color: white;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.header p {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
}

/* Tool Description */
.tool-description {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    border-left: 4px solid #004AAD;
}

.tool-description p {
    font-size: 1.1rem;
    color: #444;
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Tool Container */
.tool-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

/* Tool Wrapper */
.tool-wrapper {
    flex: 2;
    min-width: 300px;
    background: #F3F5F6;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

/* Instructions */
.instructions {
    flex: 1;
    min-width: 250px;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.instructions h3 {
    color: #004AAD;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.instructions ol, .instructions ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.instructions li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Progress Bar */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
    transform: translateY(-50%);
}

.step-indicator {
    width: 36px;
    height: 36px;
    background: #e0e0e0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #666;
    font-size: 16px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.step-indicator.active {
    background: #004AAD;
    color: white;
}

/* Steps */
.step {
    display: none;
}

.step.active {
    display: block;
}

h2 {
    color: #004AAD;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    text-align: center;
}

/* Upload Section */
.upload-box {
    border: 2px dashed #004AAD;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    margin-bottom: 1.5rem;
}

.upload-box:hover {
    border-color: #007bff;
    background: #f8faff;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-icon {
    width: 48px;
    height: 48px;
    fill: #004AAD;
    margin-bottom: 0.5rem;
}

.upload-box p {
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
}

.upload-box small {
    font-size: 0.9rem;
    color: #666;
}

.upload-box img {
    max-width: 100%;
    max-height: 300px;
    margin-top: 1rem;
    border-radius: 4px;
    object-fit: contain;
}

/* Button Styles */
.button-group {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    gap: 1rem;
}

.primary-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    flex: 1;
    font-weight: 500;
}

.primary-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.primary-button:hover:enabled {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.secondary-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    flex: 1;
    font-weight: 500;
}

.secondary-button:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Step 2: Select Requirements */
.option-buttons {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.option-button {
    flex: 1;
    padding: 0.75rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.option-button.active {
    background: #28a745;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #28a745;
}

.option-button:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.preset-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.preset-button {
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-align: center;
    color: #333;
}

.preset-button:hover {
    background: #e9ecef;
}

.preset-button.selected {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Editor Section */
.editor {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.canvas-wrapper {
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

canvas {
    max-width: 100%;
    max-height: 500px;
    display: block;
    touch-action: none;
}

.controls {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.control-group {
    flex: 1;
    min-width: 200px;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #444;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
}

.control-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 0.95rem;
}

.control-button {
    padding: 0.5rem 1rem;
    background: #B4B4B4;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 0.5rem;
}

.control-button:hover {
    background: #e9ecef;
}

/* Crop Overlay */
.crop-overlay {
    position: absolute;
    border: 2px dashed #007bff;
    background: rgba(0, 123, 255, 0.1);
    pointer-events: none;
    display: none;
    z-index: 10;
}

/* Footer */
.footer {
    background: #004AAD;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-container {
        flex-direction: column;
    }

    .option-buttons {
        flex-direction: column;
    }

    .button-group {
        flex-direction: column;
    }

    .controls {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .header p {
        font-size: 0.9rem;
    }

    .tool-description p {
        font-size: 1rem;
    }

    .step-indicator {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    h2 {
        font-size: 1.2rem;
    }
}