/* Network Page - Premium Styles */

/* ========================================
   Animated Background
   ======================================== */
.network-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(249, 115, 22, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(15, 23, 42, 1) 0%, rgba(2, 6, 23, 1) 100%);
}

.network-bg::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(249, 115, 22, 0.03) 0%, transparent 2%),
        radial-gradient(circle at 75% 75%, rgba(59, 130, 246, 0.03) 0%, transparent 2%);
    background-size: 60px 60px;
    animation: bgPan 120s linear infinite;
}

@keyframes bgPan {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 30px);
    }
}

/* ========================================
   Network Health Banner
   ======================================== */
.network-health-banner {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 1rem;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.network-health-banner.warning {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(15, 23, 42, 0.8) 100%);
    border-color: rgba(249, 115, 22, 0.3);
}

.network-health-banner.critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(15, 23, 42, 0.8) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.health-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.health-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.6);
    animation: healthPulse 2s ease-in-out infinite;
}

.health-dot.warning {
    background: #f97316;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.6);
}

.health-dot.critical {
    background: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    animation: healthPulseFast 0.8s ease-in-out infinite;
}

@keyframes healthPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.9);
    }
}

@keyframes healthPulseFast {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.85);
    }
}

/* ========================================
   Premium Stat Cards
   ======================================== */
.stat-card {
    position: relative;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 1rem;
    padding: 1.5rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    padding: 1px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.3) 0%, rgba(59, 130, 246, 0.1) 50%, rgba(168, 85, 247, 0.2) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.stat-card:hover::after {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(249, 115, 22, 0.1);
}

.stat-card .icon-wrapper {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(249, 115, 22, 0.05) 100%);
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.stat-card .icon-wrapper.green {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
    border-color: rgba(34, 197, 94, 0.2);
}

.stat-card .icon-wrapper.blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-color: rgba(59, 130, 246, 0.2);
}

.stat-card .icon-wrapper.purple {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(168, 85, 247, 0.05) 100%);
    border-color: rgba(168, 85, 247, 0.2);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.stat-card .stat-trend.up {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-card .stat-trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ========================================
   Node Map
   ======================================== */
.node-map-container {
    position: relative;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 1.5rem;
    overflow: hidden;
    min-height: 300px;
}

.node-map-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(249, 115, 22, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.node-map {
    width: 100%;
    height: 100%;
    min-height: 300px;
}

.node-marker {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f97316;
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.8);
    animation: nodeFlicker 3s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.node-marker:hover {
    transform: scale(1.5);
}

.node-marker.large {
    width: 12px;
    height: 12px;
}

.node-marker::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid rgba(249, 115, 22, 0.4);
    animation: nodeRing 2s ease-out infinite;
}

@keyframes nodeFlicker {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes nodeRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.node-tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 50;
    pointer-events: none;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.node-marker:hover+.node-tooltip,
.node-tooltip.visible {
    opacity: 1;
}

/* ========================================
   Enhanced Mempool
   ======================================== */
.mempool-container {
    position: relative;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 1.5rem;
    overflow: hidden;
    min-height: 320px;
}

.mempool-container::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(249, 115, 22, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

.mempool-stats {
    position: absolute;
    bottom: 1rem;
    left: 1.5rem;
    right: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.mempool-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mempool-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.mempool-stat-value {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    color: #fff;
}

/* ========================================
   Enhanced Terminal
   ======================================== */
.terminal-container {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.terminal-header {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.terminal-tabs {
    display: flex;
    gap: 0.25rem;
}

.terminal-tab {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.terminal-tab:hover {
    color: #94a3b8;
    background: rgba(51, 65, 85, 0.3);
}

.terminal-tab.active {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.terminal-output {
    height: 400px;
    overflow-y: auto;
    padding: 1rem;
    font-family: 'Space Mono', 'Fira Code', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
}

/* Syntax highlighting */
.terminal-output .cmd-prompt {
    color: #22c55e;
}

.terminal-output .cmd-input {
    color: #f8fafc;
}

.terminal-output .cmd-success {
    color: #22c55e;
}

.terminal-output .cmd-error {
    color: #ef4444;
}

.terminal-output .cmd-warning {
    color: #f97316;
}

.terminal-output .cmd-info {
    color: #3b82f6;
}

.terminal-output .cmd-muted {
    color: #64748b;
}

.terminal-output .cmd-highlight {
    color: #a855f7;
}

.terminal-output .cmd-value {
    color: #facc15;
}

.terminal-input-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.8);
    border-top: 1px solid rgba(51, 65, 85, 0.5);
}

.terminal-input-area input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f8fafc;
    font-family: 'Space Mono', 'Fira Code', monospace;
    font-size: 0.8125rem;
}

.terminal-input-area input::placeholder {
    color: #475569;
}

/* ========================================
   Chart Containers
   ======================================== */
.chart-container {
    position: relative;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 1.5rem;
    padding: 1.5rem;
    overflow: hidden;
}

.chart-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    padding: 1px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, transparent 50%, rgba(249, 115, 22, 0.1) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.chart-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #f8fafc;
}

.chart-subtitle {
    font-size: 0.75rem;
    color: #64748b;
}

/* ========================================
   Blockchain Visualizer Cards
   ======================================== */
.block-card {
    position: relative;
    min-width: 280px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.7) 100%);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 1rem;
    padding: 1.25rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.block-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f97316, #fb923c, #f97316);
    background-size: 200% 100%;
    animation: blockGlow 2s ease infinite;
}

@keyframes blockGlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.block-card:hover {
    transform: translateY(-2px);
    border-color: rgba(249, 115, 22, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.block-card .block-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f97316;
}

.block-card .block-hash {
    font-family: 'Space Mono', monospace;
    font-size: 0.625rem;
    color: #64748b;
    word-break: break-all;
}

.block-card .block-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.block-card .block-stat {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.3);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.block-card .block-stat-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.block-card .block-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

/* ========================================
   Latest Lists
   ======================================== */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(51, 65, 85, 0.3);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

.list-item:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(51, 65, 85, 0.5);
}

.list-item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(51, 65, 85, 0.3);
    border-radius: 0.5rem;
}

.list-item .hash-link {
    font-family: 'Space Mono', monospace;
    font-size: 0.8125rem;
    color: #3b82f6;
    transition: color 0.2s ease;
}

.list-item .hash-link:hover {
    color: #60a5fa;
}

/* ========================================
   Section Headers
   ======================================== */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(249, 115, 22, 0.05) 100%);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 0.75rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
}

/* ========================================
   Educational Banner
   ======================================== */
.edu-banner {
    margin-bottom: 1.5rem;
}

.edu-banner-inner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.08) 50%, rgba(15, 23, 42, 0.9) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 1rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.edu-banner-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.8), rgba(249, 115, 22, 0.6), rgba(245, 158, 11, 0.8));
    background-size: 200% 100%;
    animation: bannerGlow 3s ease infinite;
}

@keyframes bannerGlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.edu-banner-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(249, 115, 22, 0.1) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 0.75rem;
    color: #f59e0b;
}

.edu-banner-content {
    flex: 1;
}

.edu-banner-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 0.35rem;
    letter-spacing: 0.02em;
}

.edu-banner-text {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.5;
}

/* ========================================
   Mempool Legend
   ======================================== */
.mempool-legend {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    z-index: 10;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(51, 65, 85, 0.4);
    border-radius: 0.75rem;
    padding: 0.6rem 0.8rem;
}

.mempool-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.65rem;
    color: #94a3b8;
    white-space: nowrap;
}

.mempool-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ========================================
   Mobile Responsive
   ======================================== */
@media (max-width: 768px) {
    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .stat-card .icon-wrapper {
        width: 36px;
        height: 36px;
    }

    .network-health-banner {
        flex-direction: column;
        text-align: center;
    }

    .terminal-output {
        height: 300px;
        font-size: 0.75rem;
    }

    .block-card {
        min-width: 240px;
    }

    .node-map-container {
        min-height: 200px;
    }

    .chart-container {
        padding: 1rem;
    }

    .mempool-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .edu-banner-inner {
        padding: 0.75rem 1rem;
    }

    .edu-banner-icon {
        width: 36px;
        height: 36px;
    }

    .edu-banner-title {
        font-size: 0.85rem;
    }

    .edu-banner-text {
        font-size: 0.75rem;
    }

    .mempool-legend {
        top: 0.5rem;
        right: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .terminal-tabs {
        display: none;
    }

    .block-card {
        min-width: 200px;
        padding: 1rem;
    }

    .block-card .block-number {
        font-size: 1.25rem;
    }

    .section-header {
        margin-bottom: 1rem;
    }

    .section-icon {
        width: 32px;
        height: 32px;
    }

    .section-title {
        font-size: 1rem;
    }
}

/* ========================================
   Utility Animations
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

/* Stagger delays for grid items */
.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.15s;
}

.stagger-3 {
    animation-delay: 0.2s;
}

.stagger-4 {
    animation-delay: 0.25s;
}

.stagger-5 {
    animation-delay: 0.3s;
}

.stagger-6 {
    animation-delay: 0.35s;
}

/* Scrollbar styling */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(51, 65, 85, 0.5);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(71, 85, 105, 0.7);
}