:root {
    --primary: #ff5722;
    --primary-hover: #f4511e;
    --bg-dark: #120907;
    --card-bg: rgba(30, 18, 15, 0.7);
    --border-color: rgba(255, 107, 0, 0.15);
    --text-primary: #fef2f2;
    --text-secondary: #fca5a5;
    --success: #fbbf24;
    --error: #ef4444;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(80px);
}

.blob {
    position: absolute;
    width: 40%;
    height: 40%;
    border-radius: 50%;
    opacity: 0.15;
}

.blob-1 { top: -10%; left: -10%; background: #ff4d00; }
.blob-2 { bottom: -10%; right: -10%; background: #ef4444; }
.blob-3 { top: 30%; left: 40%; background: #f97316; }

.container {
    max-width: 600px;
    width: 90%;
    margin-top: 2rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.header {
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #ef4444, #f97316, #ffae00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    overflow: hidden;
}

.file-section {
    text-align: center;
}

.file-icon-wrapper {
    width: 64px;
    height: 64px;
    background: rgba(255, 87, 34, 0.1);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.file-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.file-section h3 {
    margin-bottom: 0.5rem;
}

.file-section p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.divider {
    height: 1px;
    background: var(--border-color);
    width: 100%;
}

.submission-section h3 {
    margin-bottom: 1rem;
}

.input-group {
    display: flex;
    gap: 0.75rem;
}

#solution-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 1rem;
    transition: all 0.2s;
}

#solution-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-submit {
    background: white;
    color: var(--bg-dark);
}

.btn-submit:hover {
    background: #f1f5f9;
}

.feedback {
    margin-top: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 1.5rem;
}

.feedback.success { color: var(--success); }
.feedback.error { color: var(--error); }

.flag-card {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    text-align: center;
}

.hidden {
    display: none !important;
}

.flag-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: var(--bg-dark);
    padding: 1rem;
    border-radius: 0.75rem;
    margin-top: 1rem;
}

#flag-content {
    font-family: var(--font-mono);
    color: var(--success);
    font-size: 1.1rem;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.1s;
}

.btn-icon:hover { color: white; }

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUpCentered {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.animate-in-centered {
    opacity: 0;
    animation: fadeInUpCentered 0.6s ease-out 0.2s forwards;
}

.image-preview-card {
    width: 1264px;
    max-width: 98vw;
    margin-left: 50%;
    /* transform handled by animation */
    display: flex;
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    border-radius: 1.5rem;
    background: var(--card-bg);
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.image-wrapper {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.image-wrapper img {
    max-width: 100%;
    height: auto;
    display: block;
    max-height: 80vh;
}

@media (max-width: 480px) {
    .input-group { flex-direction: column; }
    .card { padding: 1.5rem; }
}
