/* ===== Hero Message Flow Animation ===== */
.hero-anim-wrapper {
    position: relative;
    width: 100%;
    max-width: 110rem;
    margin: 4rem auto 0;
    z-index: 2;
}

.hero-anim-scene {
    position: relative;
    width: 100%;
    height: 58rem;
    overflow: visible;
}

/* ===== Multiple Zalo Accounts (Left) ===== */
.anim-zalo-stack {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    z-index: 10;
}

.anim-zalo-card {
    width: 18rem;
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border-radius: 1.6rem;
    border: 0.15rem solid rgba(255,255,255,0.08);
    box-shadow: 0 1.2rem 3rem rgba(0,0,0,0.25);
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: default;
}

.anim-zalo-card:hover {
    transform: scale(1.04);
    box-shadow: 0 1.6rem 4rem rgba(2,123,255,0.2);
}

.anim-zalo-card.firing {
    box-shadow: 0 0 2rem rgba(2,123,255,0.4);
}

.zalo-card-header {
    background: linear-gradient(90deg, rgba(2,123,255,0.15), rgba(0,198,255,0.08));
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 0.1rem solid rgba(255,255,255,0.05);
}

.zalo-card-avatar {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.zalo-card-name {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zalo-card-badge {
    margin-left: auto;
    background: #12B76A;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10rem;
}

.zalo-card-body {
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.zalo-mini-bubble {
    padding: 0.4rem 0.8rem;
    border-radius: 0.8rem;
    font-size: 0.75rem;
    line-height: 1.3;
    max-width: 88%;
}

.zalo-mini-bubble.incoming {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 0.2rem;
}

.zalo-mini-bubble.outgoing {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 0.2rem;
}

/* ===== Central ZeWork Dashboard (Center) ===== */
.anim-central-dash {
    position: absolute;
    left: 22rem;
    top: 50%;
    transform: translateY(-50%);
    width: 50rem;
    height: 38rem;
    background: #fff;
    border-radius: 1.6rem;
    border: 0.1rem solid #e2e8f0;
    box-shadow: 0 3rem 8rem rgba(0,0,0,0.08), 0 0 0 0.1rem rgba(2,123,255,0.04);
    z-index: 10;
    overflow: hidden;
}

/* ===== ZeWork Mobile Phone (Right) ===== */
.anim-zework-phone {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16rem;
    height: 34rem;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 2.6rem;
    border: 0.2rem solid #e2e8f0;
    box-shadow: 0 2rem 6rem rgba(0,0,0,0.12), inset 0 0.1rem 0 rgba(255,255,255,0.8);
    z-index: 10;
    overflow: hidden;
    animation: mobileFloat 5s ease-in-out infinite;
}

@keyframes mobileFloat {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(calc(-50% - 0.6rem)) translateX(0); }
}

.zw-phone-notch {
    width: 5rem;
    height: 0.5rem;
    background: #e2e8f0;
    border-radius: 0.4rem;
    margin: 0.8rem auto 0;
}

.zw-phone-header {
    background: linear-gradient(90deg, #027BFF, #0056D2);
    margin: 0.6rem 0.5rem 0;
    border-radius: 1.2rem 1.2rem 0 0;
    padding: 0.7rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.zw-phone-logo {
    width: 1.8rem;
    height: 1.8rem;
    background: #fff;
    border-radius: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    color: #027BFF;
}

.zw-phone-title {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
}

.zw-phone-screen {
    margin: 0 0.5rem 0.5rem;
    background: #f8fafc;
    border-radius: 0 0 1.2rem 1.2rem;
    border: 0.1rem solid #e2e8f0;
    border-top: none;
    height: calc(100% - 5.5rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.zw-phone-tabs {
    display: flex;
    border-bottom: 0.1rem solid #f1f5f9;
    padding: 0 0.4rem;
}

.zw-phone-tab {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0;
    font-size: 0.7rem;
    color: #94a3b8;
    border-bottom: 0.2rem solid transparent;
    transition: all 0.3s;
}

.zw-phone-tab.active {
    color: #027BFF;
    font-weight: 600;
    border-bottom-color: #027BFF;
}

.zw-phone-chats {
    flex: 1;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
}

.zw-phone-chat-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.8rem;
    transition: all 0.3s ease;
}

.zw-phone-chat-row.mobile-new {
    background: #eff6ff;
    animation: mobileRowPop 0.5s ease-out;
}

@keyframes mobileRowPop {
    0% { transform: scale(0.95); opacity: 0; background: #dbeafe; }
    100% { transform: scale(1); opacity: 1; background: #eff6ff; }
}

.zw-chat-av {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.zw-chat-info {
    flex: 1;
    min-width: 0;
}

.zw-chat-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zw-chat-msg {
    font-size: 0.68rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zw-chat-time {
    font-size: 0.6rem;
    color: #94a3b8;
}

.zw-chat-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #027BFF;
    margin-top: 0.2rem;
}

/* Phone bottom nav */
.zw-phone-nav {
    display: flex;
    border-top: 0.1rem solid #f1f5f9;
    padding: 0.5rem 0.4rem;
    background: #fff;
}

.zw-phone-nav-item {
    flex: 1;
    text-align: center;
    font-size: 0.6rem;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.zw-phone-nav-item.active {
    color: #027BFF;
}

.zw-phone-nav-item i {
    font-size: 1rem;
}

/* Label under phone */
.zw-phone-label {
    position: absolute;
    right: 1rem;
    bottom: -2.5rem;
    width: 16rem;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #027BFF;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.zw-phone-label i {
    font-size: 0.9rem;
}

/* Second connection stream to phone */
.hero-conn-to-mobile {
    position: absolute;
    z-index: 5;
    pointer-events: none;
}

.hero-conn-to-mobile svg {
    width: 100%;
    height: 100%;
}

.central-titlebar {
    background: linear-gradient(90deg, #027BFF 0%, #0056D2 100%);
    padding: 0.7rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.central-logo {
    width: 2.2rem;
    height: 2.2rem;
    background: #fff;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #027BFF;
}

.central-title {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
}

.central-titlebar-dots {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.central-titlebar-dots span {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
}
.central-titlebar-dots .dot-red { background: #ff5f56; }
.central-titlebar-dots .dot-yellow { background: #ffbd2e; }
.central-titlebar-dots .dot-green { background: #27c93f; }

.central-body {
    display: flex;
    height: calc(100% - 3.6rem);
}

/* Dashboard sidebar */
.central-sidebar {
    width: 16rem;
    background: #f8fafc;
    border-right: 0.1rem solid #e2e8f0;
    padding: 1.2rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.central-nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.6rem;
    font-size: 1rem;
    color: #64748b;
    transition: all 0.2s ease;
    cursor: default;
}

.central-nav-item.active {
    background: rgba(2,123,255,0.08);
    color: #027BFF;
    font-weight: 600;
}

.central-nav-item i {
    width: 1.4rem;
    font-size: 1rem;
    text-align: center;
}

.central-nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 10rem;
    min-width: 1.4rem;
    text-align: center;
    animation: badgePulse 2s ease-in-out infinite;
}

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

/* Chat list panel */
.central-chat-list {
    width: 20rem;
    border-right: 0.1rem solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-list-header {
    padding: 1rem;
    border-bottom: 0.1rem solid #f1f5f9;
}

.chat-list-search {
    width: 100%;
    padding: 0.5rem 0.8rem;
    border: 0.1rem solid #e2e8f0;
    border-radius: 0.6rem;
    font-size: 0.85rem;
    background: #f8fafc;
    color: #94a3b8;
    outline: none;
}

.chat-list-items {
    flex: 1;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
}

.chat-list-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.6rem;
    border-radius: 0.6rem;
    transition: all 0.3s ease;
    cursor: default;
}

.chat-list-row.active {
    background: rgba(2,123,255,0.06);
}

.chat-list-row.new-msg {
    background: #f0f7ff;
    border: 0.1rem solid #bfdbfe;
    animation: chatRowFlash 0.6s ease-out;
}

@keyframes chatRowFlash {
    0% { transform: translateX(0.5rem); opacity: 0.3; background: #dbeafe; }
    100% { transform: translateX(0); opacity: 1; background: #f0f7ff; }
}

.chat-row-avatar {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-row-info {
    flex: 1;
    min-width: 0;
}

.chat-row-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-row-preview {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
}

.chat-row-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}

.chat-row-time {
    font-size: 0.65rem;
    color: #94a3b8;
}

.chat-row-unread {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: #027BFF;
}

/* Main chat area */
.central-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-area-header {
    padding: 0.8rem 1.2rem;
    border-bottom: 0.1rem solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.chat-area-avatar {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
}

.chat-area-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.chat-area-status {
    font-size: 0.75rem;
    color: #12B76A;
}

.chat-area-messages {
    flex: 1;
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    overflow: hidden;
}

.chat-area-msg {
    padding: 0.6rem 1rem;
    border-radius: 1.2rem;
    font-size: 0.85rem;
    line-height: 1.4;
    max-width: 75%;
    opacity: 0;
    transform: translateY(0.5rem);
    transition: all 0.4s ease;
}

.chat-area-msg.visible {
    opacity: 1;
    transform: translateY(0);
}

.chat-area-msg.incoming-msg {
    background: #f1f5f9;
    color: #334155;
    align-self: flex-start;
    border-bottom-left-radius: 0.3rem;
}

.chat-area-msg.outgoing-msg {
    background: linear-gradient(135deg, #027BFF, #0056D2);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 0.3rem;
}

/* ===== Flying Messages ===== */
.hero-flying-msg {
    position: absolute;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
}

.hero-flying-bubble {
    padding: 0.5rem 1.2rem;
    border-radius: 1.4rem;
    font-size: 0.9rem;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    box-shadow: 0 0.4rem 2rem rgba(2,123,255,0.35);
}

.hero-fly-blue { background: linear-gradient(135deg, #027BFF, #0056D2); }
.hero-fly-green { background: linear-gradient(135deg, #12B76A, #039855); }
.hero-fly-purple { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.hero-fly-cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); }

/* Particle trail */
.hero-msg-particle {
    position: absolute;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    pointer-events: none;
    z-index: 15;
    opacity: 0;
}

/* ===== Connection Lines ===== */
.hero-connection-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.hero-connection-lines svg {
    width: 100%;
    height: 100%;
}

.conn-path {
    fill: none;
    stroke: rgba(2,123,255,0.08);
    stroke-width: 1.5;
    stroke-dasharray: 6 4;
}

.conn-glow {
    fill: none;
    stroke: url(#connGradient);
    stroke-width: 2;
    stroke-dasharray: 20 80;
    stroke-dashoffset: 0;
    animation: connFlow 3s linear infinite;
}

@keyframes connFlow {
    to { stroke-dashoffset: -100; }
}

/* ===== Status Bar ===== */
.hero-sync-status {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 2rem;
    background: rgba(255,255,255,0.85);
    border: 0.1rem solid rgba(2,123,255,0.15);
    border-radius: 10rem;
    z-index: 30;
    backdrop-filter: blur(1.2rem);
    box-shadow: 0 0.4rem 1.5rem rgba(0,0,0,0.06);
}

.hero-sync-dot {
    width: 0.8rem;
    height: 0.8rem;
    background: #12B76A;
    border-radius: 50%;
    animation: heroSyncPulse 2s ease-in-out infinite;
}

@keyframes heroSyncPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(18,183,106,0.4); }
    50% { box-shadow: 0 0 0 0.5rem rgba(18,183,106,0); }
}

.hero-sync-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: #334155;
}

.hero-sync-count {
    font-weight: 800;
    color: #027BFF;
    font-variant-numeric: tabular-nums;
}

.hero-sync-accounts {
    font-size: 1.1rem;
    color: #64748b;
    padding-left: 1rem;
    border-left: 0.1rem solid #e2e8f0;
}

/* ===== Animated BG Orbs ===== */
.hero-bg-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    filter: blur(4rem);
    animation: orbFloat 10s ease-in-out infinite;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(1rem, -1.5rem) scale(1.05); }
    66% { transform: translate(-0.5rem, 1rem) scale(0.95); }
}

/* ===== Responsive ===== */
@media (max-width: 1400px) {
    .hero-anim-scene { height: 52rem; }
    .anim-central-dash { width: 44rem; height: 34rem; left: 20rem; }
    .anim-zework-phone { width: 14rem; height: 30rem; }
    .anim-zalo-card { width: 16rem; }
    .central-sidebar { width: 12rem; }
    .central-chat-list { width: 16rem; }
    .zw-phone-label { width: 14rem; }
}

@media (max-width: 1200px) {
    .hero-anim-scene { height: 48rem; }
    .anim-central-dash { width: 38rem; height: 30rem; left: 18rem; }
    .anim-zalo-card { width: 14rem; }
    .anim-zework-phone { width: 13rem; height: 28rem; }
    .central-sidebar { display: none; }
    .central-chat-list { width: 15rem; }
    .zw-phone-label { width: 13rem; font-size: 0.95rem; }
}

@media (max-width: 1024px) {
    .hero-anim-wrapper { display: none; }
}
