/* =====================================================
   0G Chain - Product-Specific Styles
   ===================================================== */

/* Solution Banner Enhancement */
.solution-banner p {
    font-size: 1.25rem;
    line-height: 1.6;
}

/* ==================== Consensus Flow Visualization ==================== */
.consensus-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-4);
    font-family: var(--font-mono);
    font-size: 10px;
}

.consensus-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.consensus-nodes {
    display: flex;
    gap: 4px;
}

.validator-node {
    width: 28px;
    height: 28px;
    background: rgba(146, 0, 225, 0.2);
    border: 1px solid var(--color-purple-700);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-purple-400);
    font-size: 10px;
    transition: all 0.3s ease;
}

.validator-node.active {
    background: var(--color-purple-700);
    color: white;
    animation: validator-pulse 2s ease-in-out infinite;
}

@keyframes validator-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(146, 0, 225, 0); }
    50% { box-shadow: 0 0 12px rgba(146, 0, 225, 0.6); }
}

.consensus-arrow {
    color: var(--color-gray-600);
    font-size: 12px;
    animation: arrow-flow 1.5s ease-in-out infinite;
}

@keyframes arrow-flow {
    0%, 100% { opacity: 0.4; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(3px); }
}

.block-proposal {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-purple-700), var(--color-purple-500));
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    animation: block-bounce 2s ease-in-out infinite;
}

@keyframes block-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.voting-round {
    display: flex;
    gap: 2px;
}

.voting-round i {
    width: 18px;
    height: 18px;
    background: rgba(34, 197, 94, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-success);
    font-size: 8px;
    animation: vote-appear 2s ease-out infinite;
}

.voting-round i:nth-child(1) { animation-delay: 0s; }
.voting-round i:nth-child(2) { animation-delay: 0.2s; }
.voting-round i:nth-child(3) { animation-delay: 0.4s; }

@keyframes vote-appear {
    0%, 20% { opacity: 0; transform: scale(0); }
    40%, 100% { opacity: 1; transform: scale(1); }
}

.finalized-block {
    position: relative;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-success), #16a34a);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.finalized-block .fa-circle-check {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 12px;
    background: white;
    border-radius: 50%;
    color: var(--color-success);
}

.stage-label {
    color: var(--color-gray-500);
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==================== Execution Flow Visualization ==================== */
.execution-flow {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    font-family: var(--font-mono);
    font-size: 10px;
}

.tx-pool {
    display: flex;
    gap: 4px;
    padding-bottom: var(--space-2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tx-item {
    width: 32px;
    height: 24px;
    background: rgba(146, 0, 225, 0.2);
    border: 1px solid var(--color-purple-700);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-purple-400);
    font-size: 8px;
    animation: tx-enter 2s ease-out infinite;
}

.tx-item:nth-child(1) { animation-delay: 0s; }
.tx-item:nth-child(2) { animation-delay: 0.3s; }
.tx-item:nth-child(3) { animation-delay: 0.6s; }
.tx-item:nth-child(4) { animation-delay: 0.9s; }

@keyframes tx-enter {
    0% { opacity: 0; transform: translateY(-10px); }
    20%, 100% { opacity: 1; transform: translateY(0); }
}

.execution-threads {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.thread {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border-left: 2px solid transparent;
}

.thread.active {
    border-left-color: var(--color-purple-500);
    background: rgba(146, 0, 225, 0.1);
}

.thread-label {
    color: var(--color-gray-500);
    font-size: 8px;
    min-width: 45px;
}

.thread-progress {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.thread.active .thread-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-purple-700), var(--color-purple-500));
    border-radius: 2px;
    animation: thread-execute 2s ease-out infinite;
}

.thread:nth-child(1) .thread-progress::after { animation-delay: 0s; }
.thread:nth-child(2) .thread-progress::after { animation-delay: 0.5s; }
.thread:nth-child(3) .thread-progress::after { animation-delay: 1s; }

@keyframes thread-execute {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 100%; opacity: 0; }
}

.state-update {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.state-tree {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--color-success), #16a34a);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    animation: state-pulse 2s ease-in-out infinite;
}

@keyframes state-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(34, 197, 94, 0); }
    50% { box-shadow: 0 0 12px rgba(34, 197, 94, 0.5); }
}

.state-label {
    color: var(--color-gray-500);
    font-size: 9px;
}

/* ==================== Sharding Visualization ==================== */
.sharding-visual {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
    font-family: var(--font-mono);
    font-size: 10px;
}

.shard-input,
.shard-output {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.tx-stream {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tx-dot {
    width: 8px;
    height: 8px;
    background: var(--color-purple-500);
    border-radius: 50%;
    animation: tx-flow 2s ease-out infinite;
}

.tx-dot:nth-child(1) { animation-delay: 0s; }
.tx-dot:nth-child(2) { animation-delay: 0.3s; }
.tx-dot:nth-child(3) { animation-delay: 0.6s; }
.tx-dot:nth-child(4) { animation-delay: 0.9s; }

@keyframes tx-flow {
    0% { opacity: 1; transform: translateX(0); }
    50% { opacity: 0.5; transform: translateX(10px); }
    100% { opacity: 0; transform: translateX(20px); }
}

.shard-label {
    color: var(--color-gray-500);
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shards-container {
    display: flex;
    gap: var(--space-2);
    flex: 1;
    justify-content: center;
}

.shard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 60px;
    transition: all 0.3s ease;
}

.shard.active {
    background: rgba(146, 0, 225, 0.15);
    border-color: var(--color-purple-700);
}

.shard-header {
    color: var(--color-gray-400);
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shard.active .shard-header {
    color: var(--color-purple-400);
}

.shard-blocks {
    display: flex;
    gap: 3px;
}

.shard-block {
    width: 12px;
    height: 12px;
    background: rgba(146, 0, 225, 0.3);
    border-radius: 2px;
    animation: shard-process 1.5s ease-in-out infinite;
}

.shard.active .shard-block {
    background: var(--color-purple-600);
}

.shard-block:nth-child(1) { animation-delay: 0s; }
.shard-block:nth-child(2) { animation-delay: 0.2s; }
.shard-block:nth-child(3) { animation-delay: 0.4s; }

@keyframes shard-process {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.shard-tps {
    color: var(--color-success);
    font-size: 9px;
    font-weight: 600;
}

.infinite-scale {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-success), #16a34a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    animation: infinite-pulse 2s ease-in-out infinite;
}

@keyframes infinite-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(34, 197, 94, 0); transform: scale(1); }
    50% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.5); transform: scale(1.05); }
}

/* ==================== Responsive ==================== */
@media (max-width: 640px) {
    .consensus-flow {
        flex-wrap: wrap;
        justify-content: center;
    }

    .consensus-arrow {
        display: none;
    }

    .consensus-stage {
        margin: var(--space-2);
    }

    .sharding-visual {
        flex-direction: column;
        gap: var(--space-4);
    }

    .shards-container {
        flex-wrap: wrap;
    }

    .shard-input,
    .shard-output {
        flex-direction: row;
        gap: var(--space-3);
    }

    .tx-stream {
        flex-direction: row;
    }
}
