/* ==================== FLUTTER HERO 3D STAGE ==================== */
.flutter-hero-stage {
    position: relative;
    width: 100%;
    height: 540px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
    overflow: visible;
}

/* Ambient Background Glow Orbs */
.hero-glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}

.orb-primary {
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.32) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbPulse 6s ease-in-out infinite;
}

.orb-accent {
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.22) 0%, transparent 70%);
    bottom: 10%;
    right: 12%;
    animation: orbPulse 8s ease-in-out infinite reverse;
}

/* Subtle Perspective Grid Behind Phone */
.hero-grid-bg {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.07) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(circle, rgba(0, 0, 0, 0.85) 35%, transparent 72%);
    -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 0.85) 35%, transparent 72%);
    z-index: 1;
    animation: gridDrift 16s linear infinite;
}

/* Orbiting Halo Rings */
.hero-orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px dashed rgba(56, 189, 248, 0.25);
    pointer-events: none;
    z-index: 1;
}

.orbit-ring-outer {
    width: 440px;
    height: 440px;
    animation: slowSpin 28s linear infinite;
}

.orbit-ring-inner {
    width: 340px;
    height: 340px;
    border-style: solid;
    border-color: rgba(6, 182, 212, 0.16);
    animation: slowSpin 20s linear infinite reverse;
}

/* 3D Phone Wrapper (Receives JS Mouse Tilt) */
.phone-wrapper {
    position: relative;
    z-index: 5;
    transform-style: preserve-3d;
    transition: transform 0.18s ease-out;
    animation: phoneFloat 5.5s ease-in-out infinite;
}

/* Smartphone Device Frame */
.phone-mockup {
    width: 270px;
    height: 500px;
    background: linear-gradient(145deg, #132238 0%, #091322 100%);
    border-radius: 38px;
    padding: 11px;
    border: 2px solid rgba(56, 189, 248, 0.35);
    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.65),
        0 0 45px rgba(14, 165, 233, 0.25),
        inset 0 1px 1px rgba(255, 255, 255, 0.18);
    position: relative;
}

/* Side Hardware Buttons */
.phone-mockup::before {
    content: '';
    position: absolute;
    right: -4px;
    top: 120px;
    width: 3px;
    height: 54px;
    background: rgba(56, 189, 248, 0.45);
    border-radius: 0 3px 3px 0;
}

.phone-mockup::after {
    content: '';
    position: absolute;
    left: -4px;
    top: 105px;
    width: 3px;
    height: 36px;
    background: rgba(56, 189, 248, 0.35);
    border-radius: 3px 0 0 3px;
    box-shadow: 0 48px 0 rgba(56, 189, 248, 0.35);
}

/* Phone Inner Screen */
.phone-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #07101f 0%, #0b192e 60%, #081426 100%);
    border-radius: 28px;
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Notch / Dynamic Island */
.phone-notch {
    width: 82px;
    height: 18px;
    background: #040811;
    border-radius: 999px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 7px;
    border: 1px solid rgba(56, 189, 248, 0.15);
}

.notch-camera {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: radial-gradient(circle, #38bdf8 0%, #0c4a6e 70%);
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.7);
}

/* Status Bar */
.phone-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0 4px;
    margin-bottom: 10px;
}

.status-icons {
    display: flex;
    gap: 6px;
    font-size: 9px;
    color: var(--primary-light);
}

/* App Header inside Phone */
.phone-app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 14px;
    margin-bottom: 10px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flutter-badge-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(14, 165, 233, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: flutterPulse 3s ease-in-out infinite;
}

.app-brand-text h4 {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.app-brand-text span {
    font-size: 9px;
    color: var(--primary-light);
    font-weight: 500;
}

.hot-reload-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    font-weight: 700;
    color: #34d399;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 3px 7px;
    border-radius: 999px;
    animation: hotReloadBlink 2.4s ease-in-out infinite;
}

/* Live App Widget Cards inside Phone */
.phone-widgets {
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex: 1;
    justify-content: center;
}

.app-widget-card {
    background: rgba(17, 34, 58, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.16);
    border-radius: 14px;
    padding: 10px 11px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.app-widget-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.1), transparent);
    animation: cardShimmer 4.5s ease-in-out infinite;
}

.app-widget-card:nth-child(2)::after {
    animation-delay: 1.5s;
}

.app-widget-card:nth-child(3)::after {
    animation-delay: 3s;
}

.widget-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.widget-title-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.widget-icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.widget-icon.sky {
    background: rgba(14, 165, 233, 0.18);
    color: #38bdf8;
}

.widget-icon.mint {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
}

.widget-icon.cyan {
    background: rgba(6, 182, 212, 0.18);
    color: #22d3ee;
}

.widget-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

.widget-tag {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Widget 1: Progress Bar */
.widget-progress-track {
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.widget-progress-fill {
    height: 100%;
    width: 74%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 999px;
    animation: progressWave 3.5s ease-in-out infinite;
}

/* Widget 2: AI Streaming Bars */
.ai-stream-bars {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 14px;
}

.ai-stream-bars span {
    display: block;
    width: 3px;
    height: 6px;
    background: var(--primary-light);
    border-radius: 3px;
    animation: streamEq 1.2s ease-in-out infinite;
}

.ai-stream-bars span:nth-child(2) { animation-delay: 0.15s; }
.ai-stream-bars span:nth-child(3) { animation-delay: 0.3s; }
.ai-stream-bars span:nth-child(4) { animation-delay: 0.45s; }
.ai-stream-bars span:nth-child(5) { animation-delay: 0.6s; }

.ai-stream-label {
    font-size: 10px;
    color: var(--text-secondary);
    margin-left: 6px;
}

/* Widget 3: Weather Mini Row */
.weather-mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-secondary);
}

.weather-temp {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-light);
}

/* Phone Bottom Nav Bar */
.phone-bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 6px 4px;
    border-top: 1px solid rgba(56, 189, 248, 0.12);
    margin-top: 8px;
}

.phone-nav-item {
    font-size: 12px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.phone-nav-item.active {
    color: var(--primary-light);
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

/* Orbiting Glassmorphic Floating Badges */
.orbit-badge {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(12, 23, 41, 0.88);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 14px;
    backdrop-filter: blur(16px);
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(14, 165, 233, 0.15);
    z-index: 6;
    animation: badgeFloat 4.5s ease-in-out infinite;
    pointer-events: auto;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.orbit-badge:hover {
    transform: translateY(-4px) scale(1.04);
    border-color: var(--primary-light);
}

.orbit-badge-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: rgba(14, 165, 233, 0.16);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.orbit-badge-icon.mint {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
}

.orbit-badge-text strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.orbit-badge-text span {
    font-size: 10px;
    color: var(--text-secondary);
}

.badge-top-left {
    top: 48px;
    left: 6px;
    animation-delay: 0s;
}

.badge-top-right {
    top: 84px;
    right: 4px;
    animation-delay: 1.1s;
}

.badge-bottom-left {
    bottom: 72px;
    left: 12px;
    animation-delay: 2.2s;
}

.badge-bottom-right {
    bottom: 44px;
    right: 10px;
    animation-delay: 3.1s;
}

/* ==================== KEYFRAME ANIMATIONS ==================== */
@keyframes phoneFloat {
    0%, 100% { transform: translateY(0px) rotateY(-6deg) rotateX(2deg); }
    50% { transform: translateY(-14px) rotateY(4deg) rotateX(-2deg); }
}

@keyframes badgeFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes orbPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.75; }
    50% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
}

@keyframes slowSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes gridDrift {
    0% { background-position: 0 0; }
    100% { background-position: 28px 28px; }
}

@keyframes flutterPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes hotReloadBlink {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 rgba(16, 185, 129, 0); }
    50% { opacity: 0.85; box-shadow: 0 0 12px rgba(16, 185, 129, 0.35); }
}

@keyframes cardShimmer {
    0% { left: -100%; }
    45%, 100% { left: 160%; }
}

@keyframes progressWave {
    0%, 100% { width: 65%; }
    50% { width: 88%; }
}

@keyframes streamEq {
    0%, 100% { height: 5px; opacity: 0.5; }
    50% { height: 14px; opacity: 1; }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .flutter-hero-stage {
        height: 490px;
    }

    .badge-top-left { left: 10px; }
    .badge-top-right { right: 10px; }
    .badge-bottom-left { left: 10px; }
    .badge-bottom-right { right: 10px; }
}

@media (max-width: 768px) {
    .flutter-hero-stage {
        height: 440px;
    }

    .phone-mockup {
        width: 235px;
        height: 435px;
        border-radius: 32px;
    }

    .orbit-ring-outer {
        width: 340px;
        height: 340px;
    }

    .orbit-ring-inner {
        width: 260px;
        height: 260px;
    }

    .orbit-badge {
        padding: 7px 10px;
        gap: 7px;
    }

    .orbit-badge-icon {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }

    .orbit-badge-text strong { font-size: 11px; }
    .orbit-badge-text span { font-size: 9px; }

    .badge-top-left { top: 20px; left: 0; }
    .badge-top-right { top: 40px; right: 0; }
    .badge-bottom-left { bottom: 30px; left: 0; }
    .badge-bottom-right { bottom: 20px; right: 0; }
}

@media (max-width: 480px) {
    .flutter-hero-stage {
        height: 410px;
    }

    .badge-bottom-left,
    .badge-top-right {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .phone-wrapper,
    .orbit-badge,
    .hero-orbit-ring,
    .hero-grid-bg,
    .orb-primary,
    .orb-accent,
    .app-widget-card::after,
    .widget-progress-fill,
    .ai-stream-bars span {
        animation: none !important;
    }
}
