:root {
    --primary-color: #3a86ff;
    --secondary-color: #8338ec;
    --background-color: #0d1117;
    --card-bg-color: #161b22;
    --text-color: #c9d1d9;
    --border-color: #30363d;
    --success-color: #2ea043;
    --warning-color: #f0883e;
    --error-color: #f85149;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.wallet-info {
    font-size: 0.9rem;
    opacity: 0.8;
}

.address {
    font-family: monospace;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
}

.card {
    background-color: #1e2130;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: #fff;
}

.status-card {
    position: relative;
}

.status-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.active {
    background-color: var(--success-color);
    color: #fff;
}

.status-badge.inactive {
    background-color: var(--error-color);
    color: #fff;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.metric {
    display: flex;
    flex-direction: column;
    padding: 0.8rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.metric .label {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 0.3rem;
}

.metric .value {
    font-size: 1.1rem;
    font-weight: 500;
}

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

.rewards-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric.rewards-metric .btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    margin-left: 1rem;
}

.register-prompt {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.register-prompt code {
    display: block;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-family: monospace;
}

/* Register Form Styles */
.register-prompt {
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.register-prompt p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

#register-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 138, 244, 0.2);
}

.cli-command {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.cli-command code {
    display: block;
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    font-family: monospace;
    color: #f8f8f8;
    overflow-x: auto;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn.primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn.primary:hover {
    background-color: #5a95ff;
}

.btn.secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.btn.secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn.disabled:hover {
    background-color: var(--primary-color);
    transform: none;
    box-shadow: none;
}

.btn.secondary.disabled:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

#withdraw-form {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

#withdraw-form h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

#withdraw-form p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

#withdraw-form input {
    padding: 0.8rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 1rem;
}

.form-buttons {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.balance {
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    padding: 1rem 0;
}

/* Status message styles */
.status-message {
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    text-align: center;
    word-break: break-word;
    max-width: 100%;
    overflow: hidden;
}

.status-message.success {
    background-color: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.status-message.error {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.status-message.info {
    background-color: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.hidden {
    display: none;
}

footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.7;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Chart styles */
.chart-card {
    margin-top: 1.5rem;
}

.chart-container {
    height: 300px;
    margin-top: 1rem;
    position: relative;
}

/* Loading Animation Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1e2e;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: #4a8af4;
}

.ascii-animation {
    font-family: monospace;
    font-size: 12px;
    line-height: 1.2;
    white-space: pre;
    margin-bottom: 20px;
    color: #4a8af4;
    text-shadow: 0 0 10px rgba(74, 138, 244, 0.7);
}

.loading-text {
    font-size: 18px;
    margin-top: 20px;
    color: #ffffff;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.loading-dots:after {
    content: '.';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60% { content: '...'; }
    80%, 100% { content: ''; }
}

/* Matrix-like animation for background */
.matrix-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.matrix-column {
    position: absolute;
    top: -100px;
    color: rgba(74, 138, 244, 0.3);
    font-family: monospace;
    font-size: 16px;
    white-space: nowrap;
    animation: fall linear infinite;
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .wallet-info {
        margin-top: 0.5rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 250px;
    }
}

/* Additional animation effects */
.ascii-line {
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pulse {
    animation: asciiPulse 2s infinite;
}

@keyframes asciiPulse {
    0% { text-shadow: 0 0 5px rgba(74, 138, 244, 0.7); }
    50% { text-shadow: 0 0 20px rgba(74, 138, 244, 1); }
    100% { text-shadow: 0 0 5px rgba(74, 138, 244, 0.7); }
}

/* Glitch effect */
.glitch {
    position: relative;
    color: #4a8af4;
    animation: glitch-skew 1s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(31px, 9999px, 94px, 0); transform: skew(0.85deg); }
    5% { clip: rect(70px, 9999px, 71px, 0); transform: skew(0.17deg); }
    10% { clip: rect(33px, 9999px, 5px, 0); transform: skew(0.4deg); }
    15% { clip: rect(76px, 9999px, 64px, 0); transform: skew(0.27deg); }
    20% { clip: rect(35px, 9999px, 49px, 0); transform: skew(0.1deg); }
    25% { clip: rect(5px, 9999px, 48px, 0); transform: skew(0.19deg); }
    30% { clip: rect(8px, 9999px, 42px, 0); transform: skew(0.65deg); }
    35% { clip: rect(51px, 9999px, 21px, 0); transform: skew(0.55deg); }
    40% { clip: rect(21px, 9999px, 61px, 0); transform: skew(0.83deg); }
    45% { clip: rect(86px, 9999px, 95px, 0); transform: skew(0.27deg); }
    50% { clip: rect(31px, 9999px, 66px, 0); transform: skew(0.58deg); }
    55% { clip: rect(10px, 9999px, 56px, 0); transform: skew(0.31deg); }
    60% { clip: rect(5px, 9999px, 46px, 0); transform: skew(0.71deg); }
    65% { clip: rect(15px, 9999px, 31px, 0); transform: skew(0.28deg); }
    70% { clip: rect(57px, 9999px, 63px, 0); transform: skew(0.4deg); }
    75% { clip: rect(89px, 9999px, 6px, 0); transform: skew(0.25deg); }
    80% { clip: rect(84px, 9999px, 51px, 0); transform: skew(0.71deg); }
    85% { clip: rect(8px, 9999px, 79px, 0); transform: skew(0.33deg); }
    90% { clip: rect(92px, 9999px, 10px, 0); transform: skew(0.56deg); }
    95% { clip: rect(85px, 9999px, 93px, 0); transform: skew(0.05deg); }
    100% { clip: rect(91px, 9999px, 83px, 0); transform: skew(0.12deg); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 91px, 0); transform: skew(0.6deg); }
    5% { clip: rect(95px, 9999px, 35px, 0); transform: skew(0.63deg); }
    10% { clip: rect(54px, 9999px, 28px, 0); transform: skew(0.65deg); }
    15% { clip: rect(82px, 9999px, 73px, 0); transform: skew(0.25deg); }
    20% { clip: rect(23px, 9999px, 30px, 0); transform: skew(0.75deg); }
    25% { clip: rect(74px, 9999px, 61px, 0); transform: skew(0.49deg); }
    30% { clip: rect(71px, 9999px, 4px, 0); transform: skew(0.97deg); }
    35% { clip: rect(70px, 9999px, 61px, 0); transform: skew(0.29deg); }
    40% { clip: rect(99px, 9999px, 100px, 0); transform: skew(0.37deg); }
    45% { clip: rect(11px, 9999px, 45px, 0); transform: skew(0.62deg); }
    50% { clip: rect(40px, 9999px, 31px, 0); transform: skew(0.68deg); }
    55% { clip: rect(29px, 9999px, 71px, 0); transform: skew(0.97deg); }
    60% { clip: rect(55px, 9999px, 40px, 0); transform: skew(0.31deg); }
    65% { clip: rect(89px, 9999px, 44px, 0); transform: skew(0.59deg); }
    70% { clip: rect(54px, 9999px, 65px, 0); transform: skew(0.11deg); }
    75% { clip: rect(38px, 9999px, 46px, 0); transform: skew(0.12deg); }
    80% { clip: rect(47px, 9999px, 31px, 0); transform: skew(0.09deg); }
    85% { clip: rect(29px, 9999px, 81px, 0); transform: skew(0.75deg); }
    90% { clip: rect(8px, 9999px, 35px, 0); transform: skew(0.76deg); }
    95% { clip: rect(44px, 9999px, 37px, 0); transform: skew(0.49deg); }
    100% { clip: rect(99px, 9999px, 11px, 0); transform: skew(0.58deg); }
}

@keyframes glitch-skew {
    0% { transform: skew(-2deg); }
    10% { transform: skew(1deg); }
    20% { transform: skew(-1deg); }
    30% { transform: skew(4deg); }
    40% { transform: skew(0deg); }
    50% { transform: skew(-3deg); }
    60% { transform: skew(3deg); }
    70% { transform: skew(2deg); }
    80% { transform: skew(-2deg); }
    90% { transform: skew(-1deg); }
    100% { transform: skew(1deg); }
}

/* Card Row Layout */
.card-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

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

.withdraw-card {
    flex: 1.2;
}

.balance-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.node-status-card {
    flex: 0.8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.balance {
    font-size: 2rem;
    font-weight: 600;
    color: #4a8af4;
    margin-top: 1rem;
    text-align: center;
}

.node-status-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
}

.node-status {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.node-status-indicator {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
}

.node-status-indicator.active {
    background-color: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.node-status-indicator.inactive {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.start-btn {
    background-color: #2ecc71;
}

.stop-btn {
    background-color: #e74c3c;
}

/* Terminal Output */
.terminal-card {
    margin-bottom: 1rem;
}

.terminal-output {
    background-color: #1a1d28;
    border-radius: 4px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    color: #ddd;
    height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.4;
}

.terminal-output .success {
    color: #2ecc71;
}

.terminal-output .error {
    color: #e74c3c;
}

.terminal-output .info {
    color: #3498db;
}
