* {
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    min-height: 100vh;
}

.glass-morphism {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.upload-area {
    border: 3px dashed #cbd5e1;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #f8fafc;
}

.upload-area:hover {
    border-color: #4f46e5;
    background: #f1f5f9;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #4338ca;
    background: #eef2ff;
}

.preview-container {
    position: relative;
    max-width: 100%;
    min-height: 300px;
    background: repeating-conic-gradient(#f1f5f9 0% 25%, #e2e8f0 0% 50%) 50% / 20px 20px;
    border-radius: 12px;
    overflow: hidden;
}

#cropper-image {
    max-width: 100%;
    display: block;
}

.thumb-preview {
    filter: invert(1) contrast(1.2);
}

.mode-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 50px;
    margin-bottom: 20px;
}

.mode-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.mode-btn.active {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #4f46e5;
}

.enhance-option {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.enhance-option.active {
    border-color: #4f46e5;
    background: #eef2ff;
}

.enhance-option i {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.dimension-input,
.kb-input,
.preset-input {
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    font-size: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    width: 100%;
}

.dimension-input:focus,
.kb-input:focus,
.preset-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    transition: all 0.3s ease;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.5);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    border: 2px solid #e2e8f0;
    color: #4a5568;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover:not(:disabled) {
    border-color: #4f46e5;
    color: #4f46e5;
    transform: translateY(-2px);
}

.size-badge {
    background: #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.preset-chip {
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-chip:hover {
    background: #4f46e5;
    color: white;
}

.toast-message {
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4f46e5;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    transition: width 0.3s ease;
}

/* Document size presets */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
}