:root {
    /* Dino Lab Brand Colors - Updated for better contrast */
    --primary-color: #5B4FCF;
    /* Deeper purple for better readability */
    --primary-hover: #4A3FB8;
    --accent-color: #00B8B0;
    /* Slightly deeper teal */
    --bg-color: #FAFBFF;
    /* Slightly cooler white */
    --card-bg: #FFFFFF;
    --text-main: #1A1A2E;
    /* Darker for better contrast */
    --text-secondary: #4A5568;
    --border-color: #E2E8F0;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px rgba(91, 79, 207, 0.15);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Background Decoration */
.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url('background.png?v=2');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0.6;
    pointer-events: none;
}

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
}

h1 {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    color: #059669;
    background: #D1FAE5;
    padding: 20px 40px;
    border-radius: var(--radius-md);
    margin: 0 auto;
    max-width: fit-content;
}

/* Language Selector */
.language-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.lang-btn {
    background: white;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.lang-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Main Content */
main {
    flex: 1;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Upload Section */
.upload-section {
    width: 100%;
    max-width: 600px;
}

.upload-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 2px dashed var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-card:hover,
.upload-card.dragover {
    border-color: var(--primary-color);
    background: rgba(108, 92, 231, 0.02);
    transform: translateY(-2px);
}

.upload-icon {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.upload-card h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    margin-bottom: 10px;
}

.upload-card p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(108, 92, 231, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 10px 10px;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 10px;
}

.btn-text:hover {
    color: var(--primary-color);
}

/* Processing Section */
.processing-section {
    margin-top: 40px;
    text-align: center;
}

.dino-loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(108, 92, 231, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Result Section */
.result-section {
    width: 100%;
    margin-top: 40px;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.result-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.result-card h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.btn-download {
    width: 100%;
    margin-top: 25px;
}

.image-wrapper {
    width: 100%;
    height: 300px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.image-wrapper.checkerboard {
    background-image:
        linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
        linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: white;
}

.image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

/* CTA Section */
.cta-section {
    margin-top: 20px;
    width: 100%;
    text-align: center;
}

.cta-content {
    background: transparent;
    color: var(--primary-color);
    padding: 20px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-content:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    border-top: 1px solid var(--border-color);
    background: white;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .result-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 22px;
    }

    .upload-card {
        padding: 40px 20px;
    }
}