/* ===================================
   Premium Blockchain Explorer Styles
   Light Blue Base + Green/Yellow Accents
   =================================== */

:root {
    /* Primary Colors - Light Blue Palette */
    --primary-50: #e0f4ff;
    --primary-100: #b8e5ff;
    --primary-200: #8cd6ff;
    --primary-300: #5fc7ff;
    --primary-400: #3abcff;
    --primary-500: #00b0ff;
    --primary-600: #00a3f0;
    --primary-700: #0091de;
    --primary-800: #0080cc;
    --primary-900: #0061ad;

    /* Accent Colors */
    --accent-green: #00e676;
    --accent-green-dark: #00c853;
    --accent-green-light: #69f0ae;

    --accent-yellow: #ffd600;
    --accent-yellow-dark: #ffab00;
    --accent-yellow-light: #ffea00;

    /* Neutrals */
    --bg-primary: #f0f7ff;
    --bg-secondary: #e3f2fd;
    --bg-tertiary: #d1ebff;

    --surface-white: rgba(255, 255, 255, 0.95);
    --surface-glass: rgba(255, 255, 255, 0.7);
    --surface-glass-dark: rgba(255, 255, 255, 0.85);

    --text-primary: #0a2540;
    --text-secondary: #425466;
    --text-tertiary: #6b7c93;

    --border-light: rgba(0, 176, 255, 0.1);
    --border-medium: rgba(0, 176, 255, 0.2);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 176, 255, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 176, 255, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 176, 255, 0.16);
    --shadow-xl: 0 16px 48px rgba(0, 176, 255, 0.2);

    /* Effects */
    --glow-green: 0 0 20px rgba(0, 230, 118, 0.3);
    --glow-yellow: 0 0 20px rgba(255, 214, 0, 0.3);
    --glow-blue: 0 0 20px rgba(0, 176, 255, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ===================================
   Background Effects
   =================================== */

.bg-gradient {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        ellipse at 30% 20%,
        rgba(0, 176, 255, 0.15) 0%,
        transparent 50%
    ),
    radial-gradient(
        ellipse at 70% 80%,
        rgba(0, 230, 118, 0.08) 0%,
        transparent 50%
    ),
    radial-gradient(
        ellipse at 90% 40%,
        rgba(255, 214, 0, 0.08) 0%,
        transparent 50%
    );
    animation: gradientShift 20s ease infinite;
    z-index: -3;
}

@keyframes gradientShift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-5%, -5%) rotate(5deg); }
}

.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(0, 176, 255, 0.05) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(0, 230, 118, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: -2;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 176, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 176, 255, 0.03) 1px, transparent 1px);
    background-size: 100px 100px;
    z-index: -1;
}

/* ===================================
   Container & Layout
   =================================== */

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* ===================================
   Header
   =================================== */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--surface-glass-dark);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-green) 100%);
    border-radius: 12px;
    box-shadow: var(--glow-blue);
    position: relative;
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 6px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-500) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-600);
    background: rgba(0, 176, 255, 0.08);
}

.nav-link.active {
    color: var(--primary-700);
    background: linear-gradient(135deg, rgba(0, 176, 255, 0.15) 0%, rgba(0, 230, 118, 0.08) 100%);
    box-shadow: var(--shadow-sm);
}

.network-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(0, 230, 118, 0.1);
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-green-dark);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: var(--glow-green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* ===================================
   Stats Grid
   =================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-medium);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.stat-icon::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: white;
}

.stat-icon.green {
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-green-light) 100%);
    box-shadow: var(--glow-green);
}

.stat-icon.blue {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-300) 100%);
    box-shadow: var(--glow-blue);
}

.stat-icon.yellow {
    background: linear-gradient(135deg, var(--accent-yellow-dark) 0%, var(--accent-yellow) 100%);
    box-shadow: var(--glow-yellow);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-value .unit {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-tertiary);
}

.stat-change {
    font-size: 0.813rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    display: inline-block;
}

.stat-change.positive {
    color: var(--accent-green-dark);
    background: rgba(0, 230, 118, 0.1);
}

.stat-change.neutral {
    color: var(--text-tertiary);
    background: rgba(107, 124, 147, 0.1);
}

/* ===================================
   Main Grid & Cards
   =================================== */

.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    animation: fadeInUp 0.6s ease-out both;
    transition: all 0.4s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-medium);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.view-all {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.view-all:hover {
    color: var(--primary-700);
    transform: translateX(4px);
}

/* ===================================
   Blocks List
   =================================== */

.blocks-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.block-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.block-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(4px);
    border-color: var(--primary-300);
}

.block-number {
    font-weight: 700;
    color: var(--primary-700);
    font-size: 1rem;
}

.block-hash {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.813rem;
    color: var(--text-tertiary);
}

.block-time {
    font-size: 0.813rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ===================================
   Health Metrics
   =================================== */

.health-status {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.813rem;
    font-weight: 700;
}

.health-status.excellent {
    color: var(--accent-green-dark);
    background: rgba(0, 230, 118, 0.15);
}

.health-metrics {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.metric-bar {
    height: 8px;
    background: rgba(0, 176, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.metric-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.metric-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.metric-fill.green {
    background: linear-gradient(90deg, var(--accent-green-dark) 0%, var(--accent-green) 100%);
}

.metric-fill.blue {
    background: linear-gradient(90deg, var(--primary-600) 0%, var(--primary-400) 100%);
}

.metric-fill.yellow {
    background: linear-gradient(90deg, var(--accent-yellow-dark) 0%, var(--accent-yellow) 100%);
}

.metric-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.metric-value {
    font-weight: 700;
    color: var(--text-primary);
}

/* ===================================
   Transactions Table
   =================================== */

.transactions-table {
    overflow-x: auto;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1fr 1fr 0.8fr;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(0, 176, 255, 0.05);
    border-radius: 12px;
    font-size: 0.813rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.table-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tx-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1fr 1fr 0.8fr;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    font-size: 0.875rem;
    transition: all 0.3s ease;
    align-items: center;
}

.tx-row:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--primary-300);
}

.tx-hash {
    font-family: 'Monaco', 'Courier New', monospace;
    color: var(--primary-600);
    font-weight: 600;
}

.tx-address {
    font-family: 'Monaco', 'Courier New', monospace;
    color: var(--text-tertiary);
    font-size: 0.813rem;
}

.tx-value {
    font-weight: 700;
    color: var(--text-primary);
}

.tx-time {
    color: var(--text-tertiary);
    font-size: 0.813rem;
}

.tx-status {
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.tx-status.success {
    color: var(--accent-green-dark);
    background: rgba(0, 230, 118, 0.15);
}

/* ===================================
   Validators Grid
   =================================== */

.validators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.validator-card {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.validator-card:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-4px);
    border-color: var(--primary-300);
    box-shadow: var(--shadow-md);
}

.validator-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.validator-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-green) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1.25rem;
}

.validator-info h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.validator-address {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.validator-stats {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.validator-stat {
    text-align: center;
}

.validator-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.validator-stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        width: 100%;
        justify-content: space-around;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .table-header,
    .tx-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .table-header {
        display: none;
    }

    .tx-row {
        padding: 1rem;
    }
}

/* ===================================
   Footer
   =================================== */

.footer {
    margin-top: 4rem;
    padding: 2rem 0;
    text-align: center;
    animation: fadeInUp 1s ease-out 0.9s both;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    opacity: 0.6;
    margin: 0;
}
