:root {
    --bg-base: #030305;
    --bg-surface: rgba(20, 20, 24, 0.4);
    --bg-surface-hover: rgba(30, 30, 36, 0.6);
    --border-light: rgba(255, 255, 255, 0.06);
    --border-highlight: rgba(255, 255, 255, 0.15);

    --text-main: #f3f3f3;
    --text-muted: #9ba0aa;

    --accent-blue: #3B82F6;
    --accent-blue-glow: rgba(59, 130, 246, 0.3);
    --accent-green: #10B981;
    --accent-green-glow: rgba(16, 185, 129, 0.3);
    --accent-yellow: #ffdf00;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Ambient Background Glows */
.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.3;
    animation: pulse 10s infinite alternate;
}

.glow-blue {
    top: -10%;
    left: -5%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--accent-blue-glow) 0%, rgba(0, 0, 0, 0) 70%);
}

.glow-green {
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-green-glow) 0%, rgba(0, 0, 0, 0) 70%);
    animation-delay: -5s;
}

@keyframes pulse {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 0.2;
    }

    100% {
        transform: scale(1.1) translate(30px, 30px);
        opacity: 0.4;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.hero-section {
    text-align: center;
    margin-bottom: 4rem;
}

.network-badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 2rem;
    color: var(--accent-blue);
}

.gradient-text {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #ffffff 40%, #888888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
}

.hero-bio {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.meta-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.meta-value {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-green);
}

/* Grid Layout */
.content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.full-width {
    grid-column: span 2;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 2rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    border-color: var(--border-highlight);
}

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

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

.icon-box {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
}

.icon-box svg {
    width: 22px;
    height: 22px;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
}

/* Toggle Buttons */
.toggle-group {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.toggle-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    background: var(--bg-base);
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#toggle-water.active {
    color: var(--accent-blue);
}

#toggle-battery.active {
    color: var(--accent-green);
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

.chart-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-surface);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border-radius: 12px;
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(59, 130, 246, 0.1);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.metric-name {
    font-weight: 600;
    color: var(--text-main);
}

.count-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-left: 6px;
    color: var(--text-muted);
}

/* Metadata List */
.metadata-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.meta-row:last-child {
    border: none;
    padding-bottom: 0;
}

.meta-row span:first-child {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.address-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-family: monospace;
    font-size: 0.9rem;
}

.address-link:hover {
    text-decoration: underline;
}

/* Animations */
.animate-fade-in {
    opacity: 0;
    animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.3s;
}

.delay-3 {
    animation-delay: 0.4s;
}

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

    .full-width {
        grid-column: span 1;
    }
}

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

    .hero-section {
        margin-bottom: 2rem;
    }

    .gradient-text {
        font-size: 2.2rem;
    }

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