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

body {
    font-family: "DM Mono", monospace;
    background-color: #fafafa;
    color: rgba(0, 0, 0, 0.4);
    font-weight: 500;
    letter-spacing: -0.04em;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px 0;
}

.header {
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-direction: column;
}

.logo-icon {
    width: 37px;
    height: 37px;
    background-image: url('/assets/favicon.ico');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.logo-text {
    font-size: 24px;
    color: #333;
}

.logo-text .highlight {
    color: #ff5500;
}

.main-content {
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
}

.form-title {
    font-size: 28px;
    font-weight: 500;
    color: #333;
    text-align: center;
    margin-bottom: 32px;
    letter-spacing: -0.02em;
}

.button-group {
    margin-top: 36px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.button {
    font-family: "DM Mono", monospace;
    font-weight: 500;
    letter-spacing: -0.02em;
    font-size: 16px;
    width: 100%;
    height: 48px;
    border: 1px solid #e0e0e0;
    background-color: white;
    color: #ff5500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.button:hover {
    background-color: #eeeeee;
    border-color: #d0d0d0;
}

.button-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.note {
    text-align: center;
    font-size: 12px;
    margin-top: 24px;
}

.highlight {
    color: #ff5500;
}

.loading-section {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 60px;
}

.loader {
    width: 60px;
    height: 60px;
    border: 3px solid #ff5500;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: spin 2s linear infinite;
}

.footer {
    margin-top: auto;
    width: 100%;
    position: relative;
}

.footer-content {
    color: rgba(0, 0, 0, 0.4);
    padding: 30px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 14px;
    font-weight: 500;
}

.footer-line {
    height: 17px;
    background-color: #ff5500;
    width: 100%;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-label {
    margin-bottom: 4px;
}

.footer-value {
    color: rgba(0, 0, 0, 0.4);
    font-weight: 400;
    font-size: 12px;
}

.tokens-section {
    text-align: right;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 16px;
    display: none;
    font-size: 14px;
    white-space: pre-wrap;
    z-index: 2;
    grid-column: 1 / -1; /* Span the full width of the grid when in grid context */
}

@media (max-width: 768px) {
    .container {
        padding: 40px 16px 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        align-items: center;
    }

    .tokens-section {
        text-align: center;
    }
}

/* Network Monitor Styles */
.service-card {
    background: white;
    border: 0.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    border-color: #d0d0d0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.service-card.healthy {
    border-left: 4px solid #22C55D;
}

.service-card.unhealthy {
    border-left: 4px solid #ff5500;
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.service-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.service-status {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.service-error {
    background-color: #fef2f2;
    color: #dc2626;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 12px;
    border: 1px solid #fecaca;
}

.service-content {
    flex: 1;
    margin-bottom: 8px;
}


.service-details {
    margin: 12px 0;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.6);
}

.detail-item {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

.detail-item strong {
    color: #333;
    margin-right: 8px;
    min-width: 80px;
}

.genesis-value {
    font-family: "DM Mono", monospace;
    font-size: 11px;
    color: #666;
    margin-right: 8px;
}

.copy-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #999;
}

.copy-button:hover {
    background-color: #f5f5f5;
    color: #ff5500;
}

.copy-icon {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nested-status {
    margin-top: 8px;
    padding-left: 12px;
    border-left: 2px solid #e0e0e0;
    font-size: 11px;
}

.service-timestamp {
    font-size: 11px;
    color: #999;
    margin-top: auto;
    padding-top: 8px;
    font-style: italic;
    flex-shrink: 0;
    border-top: 1px solid #f0f0f0;
}

#status-container {
    min-height: 200px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.loading-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    grid-column: 1 / -1; /* Span the full width of the grid when in grid context */
}

/* Responsive adjustments for service cards */
@media (max-width: 768px) {
    .service-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .service-status {
        align-self: flex-end;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .detail-item strong {
        margin-bottom: 2px;
    }
}

.worker-status {
    margin: 4px 0;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    font-size: 12px;
    font-family: "DM Mono", monospace;
}

.worker-address {
    font-weight: 500;
    color: #333;
}

.worker-version {
    color: #666;
}

.worker-status-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.worker-status-badge.healthy {
    background: #d4edda;
    color: #155724;
}

.worker-status-badge.unhealthy {
    background: #f8d7da;
    color: #721c24;
}

.worker-status-badge.unknown {
    background: #fff3cd;
    color: #856404;
}

/* Transaction Prover Test Styles */
.test-metrics {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
}

.test-metrics.healthy {
    background: rgba(34, 197, 93, 0.05);
    border-left: 3px solid #22C55D;
}

.test-metrics.unhealthy {
    background: rgba(255, 85, 0, 0.05);
    border-left: 3px solid #ff5500;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0;
    font-size: 12px;
}

.metric-label {
    color: #333;
    font-weight: 500;
}

.metric-value {
    font-family: "DM Mono", monospace;
    font-weight: 500;
}

.test-metrics.healthy .metric-value {
    color: #22C55D;
}

.test-metrics.unhealthy .metric-value {
    color: #ff5500;
}

/* Refresh button container */
.refresh-button-container {
    grid-column: 1 / -1; /* Span the full width of the grid */
    margin-top: 20px;
}

/* Responsive adjustments for test metrics */
@media (max-width: 768px) {
    .metric-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    /* Adjust grid for mobile */
    #status-container {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 0 16px;
    }
}

/* Additional responsive breakpoints */
@media (max-width: 480px) {
    #status-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .service-card {
        padding: 16px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    #status-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}
