* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f7f9fc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    width: 100%;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: center;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
}

.upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    border: 2px dashed #6c63ff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
}

.upload-label:hover {
    background-color: #f0f0ff;
    border-color: #5a52d5;
    transform: translateY(-2px);
}

.upload-icon {
    width: 60px;
    height: 60px;
    fill: #6c63ff;
    margin-bottom: 15px;
}

.upload-label span {
    color: #6c63ff;
    font-weight: 500;
}

input[type="file"] {
    display: none;
}

.preview-container {
    margin-top: 20px;
    animation: fadeIn 0.5s ease;
}

.preview-wrapper {
    position: relative;
    width: 500px;
    height: 500px;
    margin: 0 auto 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn {
    background-color: #6c63ff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(108, 99, 255, 0.2);
}

.btn:hover {
    background-color: #5a52d5;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(108, 99, 255, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.hidden {
    display: none;
}

.loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.loading-spinner::after {
    content: "";
    width: 50px;
    height: 50px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #6c63ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.time-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #6c63ff;
}

.time-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.time-info-label {
    font-weight: 600;
    color: #444;
}

.time-info-value {
    color: #6c63ff;
    font-family: monospace;
    font-size: 0.9rem;
    background-color: #f0f0ff;
    padding: 4px 8px;
    border-radius: 4px;
}

.status-container {
    margin: 15px 0;
    padding: 10px;
    border-radius: 6px;
    background-color: #f0f0ff;
    color: #5a52d5;
    font-weight: 500;
    min-height: 22px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    
    .preview-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 1/1;
    }
    
    .controls {
        flex-direction: column;
    }
}