:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pretendard', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0.5) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0.5) 0, transparent 50%);
    background-attachment: fixed;
    padding: 20px;
}

.container {
    max-width: 500px;
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

header h1 span {
    color: #a5b4fc;
    background: linear-gradient(135deg, #a5b4fc 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 30px;
}

.upload-section {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 40px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.upload-section:hover, .upload-section.dragover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: #818cf8;
    margin-bottom: 15px;
}

.upload-content p {
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.btn-upload, .btn-retry {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-upload:hover, .btn-retry:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

#imagePreview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    border-radius: 14px;
}

.hidden {
    display: none !important;
}

/* Loading Spinner */
#loading {
    margin: 30px 0;
    animation: fadeIn 0.5s ease;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

/* Results */
#resultSection {
    margin-top: 30px;
    animation: slideUp 0.5s ease;
}

#resultSection h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #e2e8f0;
}

.primary-result {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#topResultName {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8 0%, #818cf8 100%);
    border-radius: 6px;
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.percent-text {
    font-size: 16px;
    font-weight: 600;
    color: #38bdf8;
    text-align: right;
}

.other-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.result-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 15px;
    border-radius: 8px;
}

.result-name {
    flex: 1;
    text-align: left;
    font-size: 14px;
    color: #cbd5e1;
}

.small-progress {
    flex: 2;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    margin: 0 10px;
    overflow: hidden;
}

.small-fill {
    height: 100%;
    background: #64748b;
    border-radius: 3px;
    width: 0%;
    transition: width 1s ease;
}

.result-percent {
    font-size: 13px;
    color: #94a3b8;
    width: 40px;
    text-align: right;
}

.btn-retry {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    box-shadow: none;
    margin-top: 10px;
}

.btn-retry:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

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

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 30px 20px;
        border-radius: 20px;
        border: none;
    }
    
    header h1 { font-size: 24px; }
    
    .upload-section { padding: 30px 15px; }
}
