* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--gray-50);
    min-height: 100vh;
    padding: 0;
    color: var(--gray-900);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    padding: 0;
}

.crop-container {
    max-width: 900px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    background: white;
    border: 3px solid var(--gray-100);
}

h1 {
    color: var(--gray-900);
    margin-bottom: 10px;
    font-size: 2em;
    font-weight: 700;
    letter-spacing: -0.025em;
}

h2 {
    color: var(--gray-900);
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
    letter-spacing: -0.025em;
}

h3 {
    color: var(--gray-600);
    margin-bottom: 15px;
    font-size: 1.125em;
    font-weight: 500;
}

.step {
    display: none;
}

.step.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step Container */
.step {
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
}

/* Schritt 1: Dimensionen */
.dimension-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.input-group {
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s;
    background: white;
}

.input-group input:hover {
    border-color: var(--gray-300);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Checkbox Group */
.checkbox-group {
    margin: 32px 0;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    border-radius: 16px;
    border: 2px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s;
}

.checkbox-group:hover {
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: var(--shadow);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-900);
}

.checkbox-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-right: 14px;
    cursor: pointer;
    accent-color: var(--primary);
    border-radius: 6px;
}

.checkbox-label span {
    font-size: 1rem;
}

.checkbox-hint {
    margin: 12px 0 0 36px;
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Schritt 2: Upload */
.upload-area {
    border: 3px dashed var(--gray-300);
    border-radius: 20px;
    padding: 80px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #fafbff 0%, #f5f7ff 100%);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.upload-prompt {
    position: relative;
    z-index: 1;
}

.upload-prompt svg {
    color: var(--primary);
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 6px rgba(102, 126, 234, 0.2));
}

.upload-prompt p {
    color: var(--gray-700);
    font-size: 1.125rem;
    margin-bottom: 12px;
    font-weight: 500;
}

.upload-hint {
    color: var(--gray-500);
    font-size: 0.875rem !important;
}

.image-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.image-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    background: white;
}

.image-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.image-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.image-item .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(239, 68, 68, 0.95);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.image-item .remove-btn:hover {
    background: var(--danger);
    transform: scale(1.1);
}

/* Schritt 3: Crop */
.crop-info {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    padding: 20px 24px;
    border-radius: 16px;
    margin-bottom: 32px;
    text-align: center;
    border: 2px solid rgba(102, 126, 234, 0.1);
    box-shadow: var(--shadow-sm);
}

.crop-info p {
    margin: 8px 0;
    color: var(--gray-700);
    font-weight: 500;
}

.crop-dimensions {
    color: var(--primary) !important;
    font-size: 1.125rem;
}

.crop-info p {
    color: #555;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.crop-dimensions {
    color: #667eea;
    font-weight: 600;
}

.crop-container {
    margin-bottom: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

.crop-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 600px;
}

#cropImage {
    max-width: 100%;
    max-height: 600px;
    display: block;
    user-select: none;
}

.crop-box {
    position: absolute;
    border: 2px solid #667eea;
    background: rgba(102, 126, 234, 0.1);
    cursor: move;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #667eea;
    border: 2px solid white;
    border-radius: 50%;
}

.crop-handle.nw {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.crop-handle.ne {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.crop-handle.sw {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.crop-handle.se {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

/* Schritt 4: Progress */
.progress-container {
    text-align: center;
    padding: 60px 40px;
}

.progress-bar {
    width: 100%;
    max-width: 600px;
    height: 12px;
    background: var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    margin: 24px auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    width: 0%;
    transition: width 0.3s ease-out;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

#progressText {
    color: var(--gray-700);
    font-size: 1.25rem;
    font-weight: 500;
    margin-top: 16px;
}

#downloadSection {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 20px;
    margin-top: 32px;
    border: 2px solid rgba(16, 185, 129, 0.2);
}

#downloadSection h3 {
    color: var(--success);
    margin-bottom: 16px;
    font-size: 2rem;
    font-weight: 700;
}

#downloadSection p {
    color: var(--gray-600);
    margin-bottom: 24px;
    font-size: 1.125rem;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.025em;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

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

    h1 {
        font-size: 1.8em;
    }

    h2 {
        font-size: 1.4em;
    }

    .dimension-inputs {
        flex-direction: column;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
