* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background-color: #1a1a1a;
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #ffffff;
    font-weight: 600;
}

.header p {
    font-size: 1.1rem;
    color: #b0b0b0;
}

/* Main Content Grid */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.upload-section, 
.result-section {
    background-color: #2d2d2d;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #404040;
}

.section-title {
    font-size: 1.4rem;
    color: #ffffff;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #666666;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #3a3a3a;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #888888;
    background-color: #404040;
}

.upload-area.dragover {
    border-color: #ffffff;
    background-color: #454545;
}

.upload-text {
    font-size: 1rem;
    color: #c0c0c0;
    margin-bottom: 15px;
}

.requirements {
    font-size: 0.9rem;
    color: #888;
    margin: 15px 0;
    line-height: 1.6;
}

.file-input {
    display: none;
}

/* Method Selector */
.method-selector {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    justify-content: center;
}

.method-btn {
    background-color: #404040;
    color: #c0c0c0;
    border: 1px solid #666666;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.method-btn:hover {
    background-color: #555555;
    color: #ffffff;
}

.method-btn.active {
    background-color: #666666;
    color: #ffffff;
    border-color: #888888;
}

/* Color Selector */
.color-selector {
    display: none;
    margin: 15px 0;
    text-align: center;
}

.color-selector label {
    display: block;
    margin-bottom: 8px;
    color: #c0c0c0;
}

.color-selector select {
    background-color: #404040;
    color: #ffffff;
    border: 1px solid #666666;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

.color-selector select:focus {
    outline: none;
    border-color: #888888;
}

/* Buttons */
.btn {
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background-color: #4a90e2;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background-color: #357abd;
}

.btn-secondary {
    background-color: #555555;
    color: #ffffff;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #666666;
}

.btn-success {
    background-color: #4caf50;
    color: #ffffff;
}

.btn-success:hover:not(:disabled) {
    background-color: #45a049;
}

.btn:disabled {
    background-color: #3a3a3a;
    color: #888888;
    cursor: not-allowed;
    opacity: 0.6;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* Preview */
.preview-container {
    text-align: center;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.placeholder-text {
    color: #666;
    padding: 40px;
}

.image-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #555555;
}

.image-info {
    color: #b0b0b0;
    margin-top: 15px;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Result Actions */
.result-actions {
    display: none;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #555555;
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages */
.message {
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: center;
    display: none;
}

.success-message {
    background-color: #2d5a2d;
    color: #ffffff;
    border: 1px solid #4a8a4a;
}

.error-message {
    background-color: #5a2d2d;
    color: #ffffff;
    border: 1px solid #8a4a4a;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.stat-card {
    background-color: #2d2d2d;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #404040;
}

.stat-number {
    font-size: 2rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.stat-label {
    color: #b0b0b0;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .method-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .method-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}