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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    width: 100%;
}

/* Header styles */
.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    flex: 1;
    text-align: center;
}

.header h1 {
    font-size: 3rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.2rem;
    color: #7f8c8d;
}

/* RPC Selector */
.rpc-selector {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 120px;
}

.rpc-selector label {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px; 
}

.rpc-dropdown {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s;
    min-width: 100px;
    width: auto;
}

.rpc-dropdown:hover {
    border-color: #007bff;
}

.rpc-dropdown:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.rpc-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #6c757d;
}

.rpc-status i {
    font-size: 7px;
}

.rpc-status.connected {
    color: #28a745;
}

.rpc-status.connecting {
    color: #ffc107;
}

.rpc-status.disconnected {
    color: #dc3545;
}

.rpc-status.connected i {
    color: #28a745;
}

.rpc-status.connecting i {
    color: #ffc107;
}

.rpc-status.disconnected i {
    color: #dc3545;
}

/* TPS Status Section */
.tps-status-section {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.tps-status-container {
    width: 100%;
    max-width: 600px;
}

.tps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 12px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tps-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    min-height: 40px;
}

.tps-item.tps-high {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.tps-item.tps-medium {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.tps-item.tps-low {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.tps-item.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.tps-label {
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    margin: 0;
    flex-shrink: 0;
}

.tps-value {
    font-size: 16px;
    font-weight: bold;
    text-align: right;
    margin: 0; 
}

/* Search container */
.search-container {
    text-align: center;
    margin-bottom: 60px;
}

.search-box {
    display: flex;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 25px;
    overflow: hidden;
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    font-size: 16px;
    outline: none;
}

/* search box button */
.search-box button {
    padding: 15px 30px;
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box button:hover {
    background-color: #2980b9;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    margin: 0 auto 20px;
}

.loading-spinner i {
    font-size: 40px;
    color: #3498db;
}

.small-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error messages */
.error {
    background-color: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.error-text {
    color: #e74c3c;
    font-family: monospace;
    font-size: 12px;
}

/* Search results */
.results {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 40px;
    width: 100%;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.result-type {
    background-color: #3498db;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
}

.result-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
}

.result-item .result-header {
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.result-item h4 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.result-details p {
    margin: 10px 0;
    word-break: break-all;
}

.result-details strong {
    color: #2c3e50;
}

.status {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.status.success {
    background-color: #2ecc71;
    color: white;
}

.status.error {
    background-color: #e74c3c;
    color: white;
}

.timestamp {
    color: #7f8c8d;
    font-size: 14px;
}

.address {
    font-family: monospace;
    font-size: 12px;
    color: #7f8c8d;
}

code {
    background-color: #f4f4f4;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    word-break: break-all;
}

.result-details code {
    background-color: #ecf0f1;
    color: #2c3e50;
}

/* Footer */
.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 30px 0;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: 0 20px;
}

.footer-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

.footer-content a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-content a:hover {
    color: #5dade2;
    text-decoration: underline;
}

.footer-content a:visited {
    color: #3498db;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #2ecc71;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    transform: translateX(100%);
    transition: transform 0.3s;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

/* Utility classes */
.hidden {
    display: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header {
        margin-bottom: 20px;
    }
    
    .tps-status-section {
        margin-bottom: 20px;
    }
    
    .tps-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px;
    }
    
    .tps-item {
        padding: 6px 10px;
        min-height: 35px;
    }
    
    .tps-label {
        font-size: 11px;
    }
    
    .tps-value {
        font-size: 14px;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .results {
        padding: 20px;
    }
    
    .result-item {
        padding: 20px;
    }
    
    .result-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer {
        margin-top: 40px;
        padding: 20px 0;
    }
    
    .footer-content {
        padding: 0 15px;
    }
    
    .footer-content p {
        font-size: 13px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        transform: translateY(-100%);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

/* Responsive adjustments for header */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .rpc-selector {
        align-items: center;
        min-width: auto;
        width: 100%;
        max-width: 200px;
    }
    
    .rpc-dropdown {
        width: 100%;
        min-width: 100px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header {
        margin-bottom: 20px;
    }
}

/* Transaction detail sections */
.expandable-section {
    margin: 15px 0;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.section-header {
    background-color: #f8f9fa;
    padding: 12px 15px;
    margin: 0;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    transition: background-color 0.2s;
}

.section-header:hover {
    background-color: #e9ecef;
}

.section-header.expanded {
    background-color: #e7f1ff;
}

/* default hide all expandable content */
.section-content {
    display: none;
    padding: 15px;
    background-color: #fff;
}

/* expand content */
.section-content.expanded {
    display: block;
}

.toggle-icon {
    font-size: 12px;
    color: #6c757d;
    transition: transform 0.2s;
}

.toggle-icon.expanded {
    transform: rotate(180deg);
}

/* icon color */
.fas.fa-check-circle {
    color: #28a745;
}

.fas.fa-times-circle {
    color: #dc3545;
}

.fas.fa-exclamation-triangle {
    color: #ffc107;
}

.fas.fa-key {
    color: #fd7e14;
}

.fas.fa-edit {
    color: #6f42c1;
}

.fas.fa-coins {
    color: #ffc107;
}

.fas.fa-wallet {
    color: #28a745;
}

/* if content is long, add some visual guidance */
.section-content:after {
    content: "";
    display: block;
    height: 1px;
    background-color: #e9ecef;
    margin-top: 10px;
}

/* Account items */
.account-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f1f3f4;
    font-size: 13px;
}

.account-item:last-child {
    border-bottom: none;
}

.account-index {
    color: #6c757d;
    font-weight: 500;
    min-width: 30px;
}

.account-address {
    font-family: monospace;
    font-size: 11px;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    word-break: break-all;
    flex: 1;
}

.account-flags {
    color: #28a745;
    font-size: 11px;
    font-weight: 500;
}

/* Instruction items */
.instruction-item {
    margin: 12px 0;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.instruction-item:first-child {
    margin-top: 0;
}

.instruction-item:last-child {
    margin-bottom: 0;
}

.instruction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.instruction-type {
    background-color: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: normal;
}

.instruction-details {
    font-size: 13px;
}

.instruction-details p {
    margin: 6px 0;
}

.instruction-accounts {
    margin-left: 15px;
    font-size: 12px;
    color: #6c757d;
}

.instruction-accounts div {
    padding: 2px 0;
}

.instruction-data {
    font-family: monospace;
    font-size: 10px;
    background-color: #fff;
    padding: 4px 6px;
    border-radius: 3px;
    word-break: break-all;
    max-width: 100%;
    display: inline-block;
}

/* Log messages */
.log-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f1f3f4;
    font-size: 13px;
}

.log-item:last-child {
    border-bottom: none;
}

.log-index {
    color: #6c757d;
    font-weight: 500;
    min-width: 30px;
    flex-shrink: 0;
}

.log-message {
    font-family: monospace;
    font-size: 11px;
    background-color: #f8f9fa;
    padding: 4px 8px;
    border-radius: 3px;
    word-break: break-all;
    flex: 1;
    line-height: 1.4;
}

/* Responsive adjustments for transaction details */
@media (max-width: 768px) {
    .section-content {
        padding: 10px;
    }
    
    .account-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .account-address {
        font-size: 10px;
        width: 100%;
    }
    
    .instruction-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .instruction-item {
        margin: 8px 0;
        padding: 10px;
    }
    
    .log-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .log-message {
        width: 100%;
        font-size: 10px;
    }
}

/* Transaction List Styles */
.transactions-container {
    margin-top: 15px;
}

.transactions-list {
    max-height: none; /* Allow full expansion */
}

.transaction-item {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 12px;
    background-color: #fafafa;
    transition: all 0.2s ease;
}

.transaction-item:hover {
    background-color: #f0f8ff;
    border-color: #007bff;
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.transaction-signature {
    display: flex;
    align-items: center;
    gap: 8px;
}

.signature-short {
    font-family: monospace;
    font-size: 12px;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
}

.signature-short:hover {
    background-color: #e9ecef;
}

.copy-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 12px;
    transition: color 0.2s;
}

.copy-btn:hover {
    color: #007bff;
    background-color: #e9ecef;
}

.transaction-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.transaction-status.tx-success {
    background-color: #d4edda;
    color: #155724;
}

.transaction-status.tx-failed {
    background-color: #f8d7da;
    color: #721c24;
}

.transaction-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    align-items: center;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #495057;
}

.detail-item i {
    color: #6c757d;
    width: 12px;
}

.view-tx-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-tx-btn:hover {
    background-color: #0056b3;
}

/* Pagination Styles */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.pagination-btn {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.pagination-btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.pagination-dots {
    color: #6c757d;
    padding: 6px;
}

/* Copy notification */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.copy-notification.show {
    transform: translateX(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .transaction-details {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .transaction-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .pagination-controls {
        gap: 4px;
    }
    
    .pagination-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* Account Transaction Styles */
.account-transactions-list {
    margin-top: 10px;
}

.account-transaction-item {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    padding: 10px;
    background-color: #fafafa;
    transition: all 0.2s ease;
}

.account-transaction-item:hover {
    background-color: #f0f8ff;
    border-color: #007bff;
}

.tx-index {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
    margin-right: 8px;
}

.loading-transactions {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 14px;
}

.loading-transactions i {
    margin-right: 8px;
}

.error-message {
    color: #dc3545;
    padding: 15px;
    background-color: #f8d7da;
    border-radius: 6px;
    margin: 10px 0;
}

.error-detail {
    color: #dc3545;
    font-size: 11px;
}

.pagination-info {
    padding: 6px 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    margin: 0 8px;
}

/* Responsive adjustments for account transactions */
@media (max-width: 768px) {
    .account-transaction-item {
        padding: 8px;
    }
    
    .transaction-details {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .pagination-btn {
        width: 100%;
    }
}

/* Program Transaction Styles */
.program-transactions-list {
    margin-top: 10px;
}

.program-transaction-item {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    padding: 10px;
    background-color: #f8f9ff; /* different background color, indicate this is program transaction */
    transition: all 0.2s ease;
    border-left: 3px solid #6f42c1; /* purple left border, distinguish program transaction */
}

.program-transaction-item:hover {
    background-color: #f0f4ff;
    border-color: #6f42c1;
}

.program-transaction-item .transaction-signature i.fa-code-branch {
    color: #6f42c1; /* program icon use purple */
}

.program-transaction-item .detail-item:nth-child(3) {
    color: #6f42c1;
    font-weight: 500;
    font-size: 12px;
}

/* Responsive adjustments for program transactions */
@media (max-width: 768px) {
    .program-transaction-item {
        padding: 8px;
        border-left-width: 2px;
    }
    
    .program-transaction-item .transaction-details {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* Vote Account Styles */
.vote-account-section {
    margin: 15px 0;
    padding: 15px;
    background-color: #f8f9ff;
    border: 1px solid #e7e3ff;
    border-radius: 8px;
    border-left: 4px solid #6f42c1;
}

.vote-account-info h5 {
    color: #6f42c1;
    margin-bottom: 10px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vote-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.vote-details p {
    margin: 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vote-details strong {
    color: #495057;
    min-width: 120px;
}

.vote-details code {
    font-size: 11px;
    background-color: #f1f3f4;
    padding: 2px 6px;
    border-radius: 3px;
    word-break: break-all;
}

.loading-vote-info {
    text-align: center;
    padding: 10px;
    color: #6c757d;
    font-size: 14px;
}

.loading-vote-info i {
    margin-right: 8px;
}

/* Responsive adjustments for vote account */
@media (max-width: 768px) {
    .vote-details {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .vote-details p {
        font-size: 12px;
    }
    
    .vote-details strong {
        min-width: 100px;
    }
    
    .vote-account-section {
        padding: 12px;
        margin: 10px 0;
    }
}

/* Stake Account Styles */
.stake-account-section {
    margin: 15px 0;
    padding: 15px;
    background-color: #fff8f0;
    border: 1px solid #ffe5cc;
    border-radius: 8px;
    border-left: 4px solid #fd7e14;
}

.stake-account-info h5 {
    color: #fd7e14;
    margin-bottom: 15px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stake-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stake-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #ffe5cc;
}

.stake-row:last-child {
    border-bottom: none;
}

.stake-details p {
    margin: 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stake-details strong {
    color: #495057;
    min-width: 140px;
}

.stake-details code {
    font-size: 11px;
    background-color: #fff3e6;
    padding: 2px 6px;
    border-radius: 3px;
    word-break: break-all;
}

.loading-stake-info {
    text-align: center;
    padding: 10px;
    color: #6c757d;
    font-size: 14px;
}

.loading-stake-info i {
    margin-right: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stake-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .stake-details strong {
        min-width: 130px;
    }
    
    .stake-account-section {
        padding: 12px;
        margin: 10px 0;
    }
}

/* Token Metadata Styles */
.token-metadata-section {
    margin: 15px 0;
    padding: 15px;
    background-color: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.token-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.token-icon {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.token-icon img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

.token-icon-fallback {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 20px;
    border: 2px solid #e5e7eb;
}

.token-metadata-info h5 {
    color: #3b82f6;
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.token-metadata-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.metadata-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #bfdbfe;
}

.metadata-row:last-child {
    border-bottom: none;
}

.token-metadata-details p {
    margin: 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.token-description {
    grid-column: 1 / -1;
    word-wrap: break-word;
}

.token-metadata-details strong {
    color: #495057;
    min-width: 140px;
}

.token-metadata-details code {
    font-size: 11px;
    background-color: #e0f2fe;
    padding: 2px 6px;
    border-radius: 3px;
    word-break: break-all;
}

.token-metadata-details a {
    color: #3b82f6;
    text-decoration: none;
}

.token-metadata-details a:hover {
    text-decoration: underline;
}

.token-attributes {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attributes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.attribute-tag {
    background-color: #e0f2fe;
    color: #0c4a6e;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.loading-token-metadata {
    text-align: center;
    padding: 10px;
    color: #6c757d;
    font-size: 14px;
}

.loading-token-metadata i {
    margin-right: 8px;
}

/* Responsive adjustments for token metadata */
@media (max-width: 768px) {
    .token-header {
        gap: 10px;
    }
    
    .token-icon,
    .token-icon img,
    .token-icon-fallback {
        width: 40px;
        height: 40px;
    }
    
    .token-icon-fallback {
        font-size: 16px;
    }
    
    .metadata-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .token-metadata-details strong {
        min-width: 130px;
    }
    
    .token-metadata-section {
        padding: 12px;
        margin: 10px 0;
    }
    
    .attributes-list {
        gap: 4px;
    }
    
    .attribute-tag {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* Memo item styling */
.memo-item {
    background-color: #f8f9fa;
    border-left: 3px solid #28a745;
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 0 4px 4px 0;
    font-family: monospace;
    word-break: break-all;
}

.memo-item i {
    color: #28a745;
    margin-right: 8px;
}

/* Transaction header layout - split into left and right sections */
.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.transaction-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0; /* Allow flex item to shrink */
}

.transaction-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0; /* Prevent shrinking */
}

/* Memo item gets full width now */
.memo-item {
    background-color: #f8f9fa;
    border-left: 3px solid #28a745;
    padding: 10px 15px;
    margin: 8px 0;
    border-radius: 0 4px 4px 0;
    font-family: monospace;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%; /* Full width for memo content */
}

.memo-item i {
    color: #28a745;
    margin-right: 8px;
}

/* Adjust view button for header placement */
.view-tx-btn {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #007bff;
    background-color: white;
    color: #007bff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.view-tx-btn:hover {
    background-color: #007bff;
    color: white;
}

/* Time info group - compact vertical layout */
.time-info-group {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 8px 0;
    border-left: 3px solid #6c757d;
}

.time-info-group .detail-item {
    margin: 4px 0;
    font-size: 13px;
}

.time-info-group .detail-item:last-child {
    margin-bottom: 0;
}

/* Memo item gets full width and stands out more */
.memo-item {
    background-color: #f8f9fa;
    border-left: 3px solid #28a745;
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 0 6px 6px 0;
    font-family: monospace;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    line-height: 1.5;
}

.memo-item i {
    color: #28a745;
    margin-right: 8px;
}

/* Transaction details container - horizontal layout */
.transaction-details {
    padding: 0 15px 0;
    background-color: white;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: flex-start;
    justify-content: flex-start;
}

.time-info-group {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 4px 8px;
    border-left: 3px solid #6c757d;
    min-width: 180px;
    max-width: 400px;
    width: fit-content;
    flex-shrink: 0;
}

.time-info-group .detail-item {
    margin: 0;
    font-size: 13px;
    white-space: nowrap;
}

.time-info-group .detail-item:last-child {
    margin-bottom: 0;
}

/* Memo item - takes remaining horizontal space on the right */
.memo-item {
    background-color: #f8f9fa;
    border-left: 3px solid #28a745;
    padding: 4px 8px;
    border-radius: 0 6px 6px 0;
    flex: 1;
    min-width: 0;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.memo-item .memo-label {
    color: #28a745;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.memo-item .memo-content {
    font-family: monospace;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 1;
    min-width: 0;
}

/* Error details - full width below time and memo */
.error-detail {
    background-color: #f8d7da;
    border-left: 3px solid #dc3545;
    padding: 8px 12px;
    border-radius: 0 4px 4px 0;
    color: #721c24;
    width: 100%;
    flex-basis: 100%;
}

/* General detail item styling */
.detail-item {
    margin: 0;
}

/* Program Interaction tag styling */
.program-interaction-tag {
    background-color: #e7f3ff;
    color: #0066cc;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
    white-space: nowrap;
    border: 1px solid #b3d9ff;
}

.program-interaction-tag i {
    margin-right: 4px;
    font-size: 10px;
}

/* Ensure transaction-left has space for the new tag */
.transaction-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0; /* Allow flex item to shrink */
    flex-wrap: wrap; /* Allow wrapping if needed */
}

/* Time info group - simplified without program interaction */
.time-info-group {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 8px 12px;
    border-left: 3px solid #6c757d;
    min-width: 180px;
    max-width: 220px; 
    width: fit-content;
    flex-shrink: 0;
}

.transaction-details:has(.time-info-group):not(:has(.memo-item)) .time-info-group {
    max-width: 100%;
    width: 100%;
}

.transaction-details-single .time-info-group {
    max-width: 100%;
    width: 100%;
}
