:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-1: #3b82f6; /* Blue */
    --accent-2: #8b5cf6; /* Purple */
    --accent-glow: rgba(139, 92, 246, 0.5);
    --error-color: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    overflow-x: hidden;
    position: relative;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 10s infinite ease-in-out alternate;
}

.glow-1 {
    top: -100px;
    left: -100px;
    background: radial-gradient(circle, var(--accent-2), transparent 70%);
}

.glow-2 {
    bottom: -100px;
    right: -100px;
    background: radial-gradient(circle, var(--accent-1), transparent 70%);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Layout */
.app-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 1;
}

.app-header {
    text-align: center;
    margin-bottom: 1rem;
}

.badge {
    display: inline-block;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
    padding: 0.25rem 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.app-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Upload Section */
.drop-zone {
    width: 100%;
    height: 300px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.2);
}

.drop-zone:hover, .drop-zone.over {
    border-color: var(--accent-2);
    background-color: rgba(139, 92, 246, 0.1);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    pointer-events: none;
    z-index: 2;
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--accent-2);
}

.drop-zone-prompt {
    font-size: 1.25rem;
    font-weight: 600;
}

.drop-zone-sub {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.drop-zone-input {
    display: none;
}

.drop-zone-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Button */
.btn {
    width: 100%;
    padding: 1rem;
    margin-top: 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #334155;
    box-shadow: none;
}

/* Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.hidden {
    display: none !important;
}

/* Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stats-pills {
    display: flex;
    gap: 0.5rem;
}

.stat-pill {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.stat-pill.highlight {
    background: rgba(139, 92, 246, 0.3);
    color: #e9d5ff;
    border: 1px solid rgba(139, 92, 246, 0.5);
}

.canvas-wrapper {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    display: flex;
    justify-content: center;
}

canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Error Banner */
.error-banner {
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--error-color);
    color: #fca5a5;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-weight: 600;
}
