:root {
    --bg-main: #0b0f19;
    --bg-card: #131c2e;
    --bg-input: #0b0f19;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --accent-glow: rgba(56, 189, 248, 0.35);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --success: #10b981;
    --error: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 1rem;
    overflow-x: hidden;
    position: relative;
}

/* Background atmospheric gradient circles */
body::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(circle, rgba(56,189,248,0.08) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 680px;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

/* Interactive Homer Avatar */
.pigeon-icon {
    font-size: 3.5rem;
    display: inline-block;
    cursor: pointer;
    user-select: none;
    animation: idleFloat 3.5s ease-in-out infinite;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.3));
}

.pigeon-icon:hover {
    transform: scale(1.2) rotate(5deg);
}

.pigeon-icon:active {
    transform: scale(0.9) rotate(-10deg);
}

/* Keyframe animations for Homer */
@keyframes idleFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(-3deg); }
}

.pigeon-icon.pecking {
    animation: peckAction 0.25s ease infinite alternate;
}

@keyframes peckAction {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(8px) rotate(15deg) scale(1.05); }
}

/* Flying animation overlay across screen during transfer */
.sky-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    overflow: hidden;
    z-index: 999;
}

.flying-homer {
    position: absolute;
    font-size: 2.5rem;
    transform: translateX(-150px);
    opacity: 0;
    transition: none;
}

@keyframes flyAcross {
    0% { transform: translate(-100px, 60vh) rotate(-10deg) scale(0.8); opacity: 0; }
    20% { opacity: 1; }
    50% { transform: translate(50vw, 20vh) rotate(5deg) scale(1.2); }
    80% { opacity: 1; }
    100% { transform: translate(calc(100vw + 100px), 40vh) rotate(-5deg) scale(1); opacity: 0; }
}

.flying-homer.active {
    animation: flyAcross 2.2s ease-in-out infinite;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
}

header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.03) inset;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 14px 40px -10px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
}

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

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

.step-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--accent);
}

.step-title span {
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent);
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.9rem;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: var(--bg-main);
    font-weight: 700;
    border: none;
    border-radius: 10px;
    padding: 0.85rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 0.95rem;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.btn:hover {
    box-shadow: 0 6px 22px rgba(56, 189, 248, 0.5);
    transform: translateY(-2px);
}

.btn:active {
    transform: scale(0.98) translateY(0);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
    transform: translateY(-2px);
}

textarea, input[type="text"] {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-main);
    padding: 0.85rem;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

textarea:focus, input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

.hidden {
    display: none !important;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2.75rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 1rem;
    background-color: rgba(11, 15, 25, 0.6);
}

.drop-icon {
    font-size: 2.8rem;
    margin-bottom: 0.75rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.drop-zone:hover .drop-icon {
    transform: scale(1.2) translateY(-5px) rotate(-8deg);
}

.drop-zone.dragover {
    border-color: var(--accent);
    background-color: rgba(56, 189, 248, 0.08);
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.2) inset;
    transform: scale(1.01);
}

.drop-zone p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.drop-zone span {
    color: var(--accent);
    font-weight: 600;
}

.progress-container {
    margin-top: 1.25rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.progress-bar-bg {
    width: 100%;
    height: 12px;
    background-color: var(--bg-input);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 5px;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.status-badge {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.status-disconnected { background: rgba(239, 68, 68, 0.15); color: var(--error); border: 1px solid rgba(239, 68, 68, 0.3); }
.status-connected { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); animation: pulseGlowSuccess 2s infinite; }
.status-gathering { background: rgba(56, 189, 248, 0.15); color: var(--accent); border: 1px solid rgba(56, 189, 248, 0.3); animation: pulseGlow 1.5s infinite; }

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(56, 189, 248, 0); }
    100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

@keyframes pulseGlowSuccess {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.flex-row {
    display: flex;
    gap: 0.75rem;
}

.flex-row > * {
    flex: 1;
}

.badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}