/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Be Vietnam Pro', sans-serif;
    background: linear-gradient(180deg, #F8FAFF 0%, #EEF5FF 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Container */
.container {
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 122, 255, 0.1);
    padding: 40px;
    max-width: 1200px;
    width: 100%;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.header p {
    font-size: 16px;
    color: #666;
    font-weight: 400;
}

/* Content layout */
.content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* Preview section */
.preview-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-container {
    position: relative;
    width: 534px;
    height: 534px;
    background: #f5f5f5;
    border-radius: 16px;
    overflow: hidden;
    cursor: move;
    user-select: none;
}

.preview-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.circular-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: circle(50% at 50% 50%);
    overflow: hidden;
}

.avatar-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center;
    pointer-events: none;
}

.frame-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Control section */
.control-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Upload area */
.upload-area {
    border: 2px dashed #007AFF;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #F8FAFF;
}

.upload-area:hover {
    background: #EEF5FF;
    border-color: #0051D5;
}

.upload-area.dragging {
    background: #E3F2FF;
    border-color: #0051D5;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-text {
    font-size: 16px;
    color: #007AFF;
    font-weight: 600;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 14px;
    color: #999;
}

input[type="file"] {
    display: none;
}

/* Control groups */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-value {
    color: #007AFF;
    font-weight: 500;
}

/* Styled sliders */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #E5E5E5;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007AFF;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(0, 122, 255, 0.1);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007AFF;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(0, 122, 255, 0.1);
}

/* Buttons */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Be Vietnam Pro', sans-serif;
}

.btn-primary {
    background: #007AFF;
    color: white;
}

.btn-primary:hover {
    background: #0051D5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #F0F0F0;
    color: #1a1a1a;
}

.btn-secondary:hover {
    background: #E5E5E5;
}

.btn-secondary:disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
}

/* Utility classes */
.hidden {
    display: none;
}

/* Responsive design */
@media (max-width: 1024px) {
    .content {
        grid-template-columns: 1fr;
    }

    .preview-container {
        width: 100%;
        max-width: 534px;
        height: auto;
        aspect-ratio: 1;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 24px;
    }

    .header h1 {
        font-size: 24px;
    }

    .header p {
        font-size: 14px;
    }

    .button-group {
        flex-direction: column;
    }
}