/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Header */
.header {
    text-align: center;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.title-emoji {
    display: inline-block;
    animation: bounce 2s infinite;
    margin-right: 0.5rem;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-10px);
    }
    70% {
        transform: translateY(-5px);
    }
    90% {
        transform: translateY(-2px);
    }
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

/* Main content */
.main {
    padding: 3rem 2rem;
    position: relative;
}

/* Upload section */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 3rem;
}

.upload-box {
    position: relative;
    border: 3px dashed #cbd5e0;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    background: #f7fafc;
    transition: all 0.3s ease;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.upload-box:hover {
    border-color: #4facfe;
    background: #edf2f7;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.upload-box.has-image {
    border-style: solid;
    border-color: #48bb78;
    background: #f0fff4;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.upload-label {
    cursor: pointer;
    display: block;
    width: 100%;
    height: 100%;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.upload-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.upload-description {
    font-size: 0.9rem;
    color: #718096;
}

.image-preview {
    display: none;
    max-width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-preview img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
}

.image-preview.active {
    display: block;
}

.image-preview.active + .upload-label {
    display: none;
}

/* VS divider */
.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 30px rgba(102, 126, 234, 0.6);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    }
}

/* Compare button */
.compare-btn {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.compare-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.6);
}

.compare-btn:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-icon {
    font-size: 1.2rem;
}

/* Result section */
.result-section {
    margin-top: 3rem;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.result-section.active {
    opacity: 1;
}

.result-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.result-header {
    background: linear-gradient(135deg, #fc466b 0%, #3f5efb 100%);
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.result-body {
    padding: 3rem 2rem;
    text-align: center;
}

.score-display {
    margin-bottom: 2rem;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.score-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.score-unit {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    position: absolute;
    bottom: 35px;
    right: 25px;
}

.score-description {
    color: #4a5568;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-left: 4px solid #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.loading-text {
    font-size: 1.1rem;
    color: #4a5568;
    font-weight: 500;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    background: #f8fafc;
    color: #718096;
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 0.5rem;
}

.footer-tech {
    margin: 0;
    color: #718096;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    color: #667eea;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.footer-link:hover {
    color: #667eea;
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .upload-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        place-items: center;
    }
    
    .vs-divider {
        width: 60px;
        height: 60px;
        font-size: 1rem;
        margin: 0.5rem 0;
        align-self: center;
        justify-self: center;
    }
    
    .upload-box {
        min-height: 200px;
        padding: 1.5rem;
        width: 100%;
        max-width: 400px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    .score-value {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .footer-nav {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 15px;
    }
    
    .header {
        padding: 2rem 1rem 1.5rem;
    }
    
    .main {
        padding: 2rem 1rem;
    }
    
    .upload-grid {
        gap: 1rem;
    }
    
    .vs-divider {
        width: 50px;
        height: 50px;
        font-size: 0.9rem;
        margin: 0.25rem 0;
    }
    
    .upload-box {
        min-height: 180px;
        padding: 1rem;
        max-width: none;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .footer-link {
        font-size: 0.85rem;
    }
}