:root {
    --primary-green: #22c55e;
    --secondary-green: #16a34a;
    --accent-yellow: #fbbf24;
    --sky-blue: #38bdf8;
    --earth-brown: #92400e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    overflow-x: hidden;
}

.farm-bg {
    background: linear-gradient(180deg, 
        #7dd3fc 0%, 
        #bae6fd 20%,
        #e0f2fe 40%,
        #86efac 60%,
        #4ade80 80%,
        #22c55e 100%);
    min-height: 100vh;
    position: relative;
}

.sun {
    position: fixed;
    top: 60px;
    right: 10%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #fef08a 0%, #fbbf24 50%, #f59e0b 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 60px 30px rgba(251, 191, 36, 0.4),
        0 0 100px 60px rgba(251, 191, 36, 0.2),
        0 0 140px 90px rgba(251, 191, 36, 0.1);
    animation: sunPulse 4s ease-in-out infinite, sunFloat 8s ease-in-out infinite;
}

@keyframes sunPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes sunFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.sun-rays {
    position: absolute;
    width: 200px;
    height: 200px;
    top: -50px;
    left: -50px;
    animation: sunRaysSpin 20s linear infinite;
}

@keyframes sunRaysSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.cloud {
    position: fixed;
    background: white;
    border-radius: 50%;
    opacity: 0.9;
    filter: blur(1px);
}

.cloud::before, .cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
}

.cloud-1 {
    width: 120px;
    height: 40px;
    top: 80px;
    left: -150px;
    animation: cloudMove 25s linear infinite;
}
.cloud-1::before { width: 50px; height: 50px; top: -25px; left: 20px; }
.cloud-1::after { width: 60px; height: 60px; top: -30px; left: 50px; }

.cloud-2 {
    width: 100px;
    height: 35px;
    top: 150px;
    left: -120px;
    animation: cloudMove 30s linear infinite 5s;
}
.cloud-2::before { width: 45px; height: 45px; top: -22px; left: 15px; }
.cloud-2::after { width: 50px; height: 50px; top: -25px; left: 45px; }

.cloud-3 {
    width: 80px;
    height: 30px;
    top: 120px;
    left: -100px;
    animation: cloudMove 35s linear infinite 10s;
    opacity: 0.7;
}
.cloud-3::before { width: 35px; height: 35px; top: -18px; left: 10px; }
.cloud-3::after { width: 40px; height: 40px; top: -20px; left: 35px; }

@keyframes cloudMove {
    from { transform: translateX(0); }
    to { transform: translateX(calc(100vw + 200px)); }
}

.grass {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(180deg, transparent 0%, #22c55e 100%);
    pointer-events: none;
}

.grass-blade {
    position: absolute;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to top, #16a34a, #4ade80);
    border-radius: 50% 50% 0 0;
    transform-origin: bottom center;
    animation: grassWave 3s ease-in-out infinite;
}

@keyframes grassWave {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.butterfly {
    position: fixed;
    width: 20px;
    height: 20px;
    animation: butterflyFly 15s ease-in-out infinite;
}

.butterfly-wing {
    position: absolute;
    width: 10px;
    height: 15px;
    background: linear-gradient(135deg, #f472b6, #c084fc);
    border-radius: 50% 50% 50% 0;
    animation: wingFlap 0.2s ease-in-out infinite alternate;
}

.butterfly-wing.left {
    left: 0;
    transform-origin: right center;
}

.butterfly-wing.right {
    right: 0;
    transform-origin: left center;
    transform: scaleX(-1);
}

@keyframes wingFlap {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(70deg); }
}

@keyframes butterflyFly {
    0% { transform: translate(0, 0); }
    25% { transform: translate(100px, -50px); }
    50% { transform: translate(200px, 20px); }
    75% { transform: translate(100px, -30px); }
    100% { transform: translate(0, 0); }
}

.particle {
    position: fixed;
    width: 6px;
    height: 6px;
    background: rgba(251, 191, 36, 0.6);
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 8s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% { 
        transform: translateY(0) rotate(0deg);
        opacity: 0.6;
    }
    50% { 
        transform: translateY(-100px) rotate(180deg);
        opacity: 0.2;
    }
}

.main-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.main-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #22c55e, #4ade80, #86efac, #4ade80, #22c55e);
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.main-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 35px 60px -15px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.log-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 
        0 10px 40px -10px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.5);
}

.btn-primary {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
    transform-origin: center;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary.loading {
    animation: buttonLoading 1s ease-in-out;
}

@keyframes buttonLoading {
    0% { transform: scale(1); }
    25% { transform: scale(1.05) rotate(2deg); }
    50% { transform: scale(1) rotate(-2deg); }
    75% { transform: scale(1.05) rotate(1deg); }
    100% { transform: scale(1); }
}

.btn-primary.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.qr-container {
    position: relative;
    padding: 20px;
    width: 280px;
    height: 280px;
    background: white;
    border-radius: 16px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
    overflow: hidden;
}

#qrcode {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s ease;
}

.qr-container:hover {
    transform: scale(1.02);
}

#qrPlaceholder {
    transition: all 0.5s ease;
}

.qr-container.qr-fade-out #qrPlaceholder {
    animation: fadeOutScale 0.5s ease-out forwards;
}

.qr-container.qr-fade-in #qrcode {
    animation: fadeInScale 0.5s ease-out forwards;
}

@keyframes fadeOutScale {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.qr-container.scanning .scan-line {
    display: block;
}

.scan-line {
    display: none;
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #22c55e 20%, 
        #4ade80 50%, 
        #22c55e 80%, 
        transparent 100%);
    border-radius: 2px;
    animation: scanMove 2s ease-in-out infinite;
    box-shadow: 0 0 10px #22c55e, 0 0 20px rgba(34, 197, 94, 0.5);
}

@keyframes scanMove {
    0%, 100% { top: 20px; }
    50% { top: calc(100% - 23px); }
}

.qr-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid #22c55e;
}

.qr-corner.tl { top: 10px; left: 10px; border-right: none; border-bottom: none; border-radius: 8px 0 0 0; }
.qr-corner.tr { top: 10px; right: 10px; border-left: none; border-bottom: none; border-radius: 0 8px 0 0; }
.qr-corner.bl { bottom: 10px; left: 10px; border-right: none; border-top: none; border-radius: 0 0 0 8px; }
.qr-corner.br { bottom: 10px; right: 10px; border-left: none; border-top: none; border-radius: 0 0 8px 0; }

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 2px solid #22c55e;
    border-radius: 16px;
    animation: pulseRing 2s ease-out infinite;
    pointer-events: none;
}

@keyframes pulseRing {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0; }
}

.progress-bar-container {
    background: #e5e7eb;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #22c55e, #4ade80, #86efac);
    background-size: 200% 100%;
    animation: progressGradient 2s linear infinite;
    transition: width 1s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.step-item:hover {
    background: rgba(34, 197, 94, 0.1);
    transform: translateX(5px);
}

.step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #22c55e, #4ade80);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3);
}

.user-card {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(74, 222, 128, 0.05));
    border: 2px solid rgba(34, 197, 94, 0.3);
    border-radius: 16px;
    padding: 20px;
    animation: userCardAppear 0.5s ease-out;
}

@keyframes userCardAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3);
    animation: avatarBounce 0.6s ease-out;
}

@keyframes avatarBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-icon {
    animation: successPop 0.5s ease-out;
}

@keyframes successPop {
    0% { transform: scale(0) rotate(-180deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.log-entry {
    animation: logSlide 0.3s ease-out;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 12px;
    font-family: 'Consolas', monospace;
}

@keyframes logSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-info { background: rgba(59, 130, 246, 0.1); border-left: 3px solid #3b82f6; }
.log-success { background: rgba(34, 197, 94, 0.1); border-left: 3px solid #22c55e; }
.log-error { background: rgba(239, 68, 68, 0.1); border-left: 3px solid #ef4444; }
.log-warning { background: rgba(245, 158, 11, 0.1); border-left: 3px solid #f59e0b; }

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
}

.status-dot.connected {
    background: #22c55e;
    animation: statusPulse 2s ease-in-out infinite;
}

.status-dot.disconnected {
    background: #ef4444;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

.title-gradient {
    background: linear-gradient(135deg, #16a34a, #22c55e, #4ade80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    pointer-events: none;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.leaf {
    position: fixed;
    width: 15px;
    height: 15px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 0 50% 50% 50%;
    pointer-events: none;
    animation: leafFall 10s linear infinite;
}

@keyframes leafFall {
    0% {
        transform: translateY(-100px) rotate(0deg) translateX(0);
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh) rotate(360deg) translateX(100px);
        opacity: 0;
    }
}

.farm-icon {
    font-size: 24px;
    margin-right: 8px;
    animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@media (max-width: 768px) {
    .sun {
        width: 60px;
        height: 60px;
        top: 30px;
        right: 5%;
    }
}
