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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ffeef8 0%, #f8e6ff 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 10px 0;
}

.tokens-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.diamond-icon {
    font-size: 16px;
}

.load-tokens-btn {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-tokens-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 20, 147, 0.3);
}

/* Main Title */
.main-title {
    text-align: center;
    margin-bottom: 40px;
}

.title-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.main-title h1 {
    font-size: 42px;
    font-weight: bold;
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 16px;
    color: #666;
    font-weight: 400;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    background: white;
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 200px;
}

.upload-area:hover {
    border-color: #ff69b4;
    background: #fafafa;
}

.upload-area.dragover {
    border-color: #ff1493;
    background: #fff0f8;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.6;
}

.upload-area h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #333;
}

.upload-area p {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.choose-image-btn {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.choose-image-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 20, 147, 0.3);
}

/* Uploaded Image Styles */
.uploaded-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.uploaded-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.uploaded-image-container:hover .image-overlay {
    opacity: 1;
}

.image-overlay .upload-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.image-overlay h3 {
    font-size: 18px;
    margin-bottom: 5px;
    color: #333;
}

.image-overlay p {
    font-size: 12px;
    color: #666;
    margin-bottom: 15px;
}

.image-overlay .choose-image-btn {
    font-size: 12px;
    padding: 8px 16px;
}

/* Remove Button */
.remove-btn {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 10px;
    display: block;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.remove-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 20, 147, 0.4);
}

.remove-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.instruction-text {
    text-align: center;
    font-size: 14px;
    color: #888;
    margin-bottom: 30px;
}

/* Main Image Section */
.main-image-section {
    text-align: center;
    margin-bottom: 40px;
}

.main-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-image:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Preview Section */
.preview-section {
    margin-bottom: 40px;
    text-align: center;
}

.image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.image-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Crop Handles */
.crop-handles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.handle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #ff69b4;
    border-radius: 50%;
    pointer-events: all;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

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

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

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

/* Terms Section */
.terms-section {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.warning-icon {
    font-size: 24px;
    color: #ff6b6b;
    flex-shrink: 0;
}

.terms-text {
    font-size: 13px;
    line-height: 1.5;
    color: #555;
}

.terms-text p {
    margin-bottom: 8px;
}

.terms-text p:last-child {
    margin-bottom: 0;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: auto;
    padding: 20px 0;
}

.footer p {
    font-size: 12px;
    color: #888;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .main-title h1 {
        font-size: 32px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .terms-section {
        flex-direction: column;
        text-align: center;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .tokens-info {
        justify-content: center;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success Animation */
@keyframes success {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.success-animation {
    animation: success 0.6s ease-in-out;
}
