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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #131f37 0%, #1a2a4a 50%, #0f1e2e 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #00e5cc 0%, #00b8d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1.1em;
    opacity: 0.8;
    color: #b0c4de;
}

.search-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 229, 204, 0.2);
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.mode-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 229, 204, 0.05);
    border-radius: 10px;
    border: 2px solid rgba(0, 229, 204, 0.1);
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 8px;
    transition: background 0.3s;
}

.mode-option:hover {
    background: rgba(0, 229, 204, 0.1);
}

.mode-option input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #00e5cc;
}

.mode-option span {
    font-weight: 600;
    color: #131f37;
    font-size: 0.95em;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group-multi {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95em;
    font-family: monospace;
    transition: border-color 0.3s;
    resize: vertical;
    min-height: 150px;
}

textarea:focus {
    outline: none;
    border-color: #00e5cc;
    box-shadow: 0 0 0 3px rgba(0, 229, 204, 0.1);
}

input[type="text"] {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    font-family: monospace;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #00e5cc;
    box-shadow: 0 0 0 3px rgba(0, 229, 204, 0.1);
}

select {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
    min-width: 100px;
}

select:focus {
    outline: none;
    border-color: #00e5cc;
    box-shadow: 0 0 0 3px rgba(0, 229, 204, 0.1);
}

button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #00e5cc 0%, #00b8d4 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 229, 204, 0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.stats-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 229, 204, 0.2);
    display: none;
}

.stats-card.visible {
    display: block;
    animation: fadeIn 0.5s;
}

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

.wallet-info {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.wallet-info h2 {
    color: #131f37;
    margin-bottom: 15px;
}

.wallet-address {
    word-break: break-all;
    font-family: monospace;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.9em;
    border-left: 4px solid #00e5cc;
}

.address-list {
    margin-top: 15px;
}

.address-list-item {
    font-family: monospace;
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.85em;
    border-left: 4px solid #00e5cc;
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 10px;
}

.address-list-item .address-number {
    background: #00e5cc;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9em;
    min-width: 40px;
    text-align: center;
}

.address-list-item .address-text {
    flex: 1;
    color: #131f37;
}

.stats-grid-primary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stats-grid-secondary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat-item {
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    transition:
        transform 0.3s,
        box-shadow 0.3s;
    position: relative;
}

.stat-item-primary {
    background: linear-gradient(135deg, #e8f5f3 0%, #d4edea 100%);
    border: 1px solid rgba(0, 229, 204, 0.2);
}

.stat-item-primary:first-child {
    background: linear-gradient(135deg, #00e5cc 0%, #00b8d4 100%);
    border: 2px solid #00b8d4;
    box-shadow: 0 5px 25px rgba(0, 229, 204, 0.3);
}

.stat-item-primary:first-child .stat-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1em;
}

.stat-item-primary:first-child .stat-value {
    color: white;
    font-size: 2em;
}

.stat-item-primary .stat-value {
    font-size: 1.8em;
}

.stat-item-secondary {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px;
}

.stat-item-secondary .stat-label {
    font-size: 0.8em;
}

.stat-item-secondary .stat-value {
    font-size: 1.3em;
}

.stat-fiat {
    font-size: 1em;
    margin-top: 8px;
    font-weight: 600;
    opacity: 0.85;
}

.stat-item-primary:first-child .stat-fiat {
    color: rgba(255, 255, 255, 0.9);
}

.stat-item-primary:not(:first-child) .stat-fiat {
    color: #00b8d4;
    font-size: 0.95em;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 229, 204, 0.2);
}

.stat-item-primary:first-child:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 229, 204, 0.5);
}

.stat-item-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.6em;
    font-weight: bold;
    color: #131f37;
    word-break: break-word;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #00e5cc;
    font-size: 1.2em;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #00e5cc;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

.loading-progress {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.progress-item {
    font-size: 0.95em;
    color: #131f37;
    margin-bottom: 15px;
    font-weight: 600;
}

.progress-bar-container {
    width: 100%;
    height: 25px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00e5cc 0%, #00b8d4 100%);
    border-radius: 12px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85em;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 229, 204, 0.3);
    position: relative;
    overflow: hidden;
}

.progress-bar::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 1.5s infinite;
}

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

.error {
    background: #fee;
    border-left: 4px solid #f44336;
    padding: 15px;
    border-radius: 8px;
    color: #c62828;
    margin-top: 20px;
}

.coins-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.coins-section h3 {
    margin-bottom: 15px;
    color: #131f37;
}

.coin-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #00e5cc;
    font-size: 0.9em;
}

.coin-item strong {
    color: #00b8d4;
}

.coin-id {
    font-family: monospace;
    font-size: 0.8em;
    word-break: break-all;
    background: #fff;
    padding: 5px;
    border-radius: 4px;
    margin-top: 5px;
}

.info-text {
    background: rgba(0, 229, 204, 0.1);
    border-left: 4px solid #00e5cc;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 0.9em;
    color: #0d7377;
}

.transaction-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(0, 229, 204, 0.2);
}

.load-more-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #00e5cc 0%, #00b8d4 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: bold;
    cursor: pointer;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 229, 204, 0.4);
}

.load-more-btn:active {
    transform: translateY(0);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: linear-gradient(135deg, #888 0%, #666 100%);
}

.validator-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #6c63ff;
}

.validator-address {
    font-family: monospace;
    font-size: 0.85em;
    word-break: break-all;
    background: #fff;
    padding: 8px;
    border-radius: 4px;
    margin-top: 5px;
    color: #6c63ff;
}

.validator-address a {
    color: #6c63ff;
    text-decoration: none;
    transition:
        color 0.2s,
        text-decoration 0.2s;
}

.validator-address a:hover {
    color: #5a52d5;
    text-decoration: underline;
}

.validator-address a:visited {
    color: #6c63ff;
}

.stake-item {
    background: #fff;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    border: 1px solid #e0e0e0;
}

.stake-detail {
    margin: 8px 0;
    font-size: 0.9em;
}

.stake-detail strong {
    color: #131f37;
}

.stake-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    margin-left: 10px;
}

.stake-status.active {
    background: #4caf50;
    color: white;
}

.stake-status.pending {
    background: #ff9800;
    color: white;
}

.stake-status.unstaked {
    background: #9e9e9e;
    color: white;
}

.staking-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 700;
    margin-left: 10px;
    background: linear-gradient(135deg, #6c63ff 0%, #5a52d5 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

.transaction-item {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.transaction-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.transaction-item.staking-transaction {
    border-left: 4px solid #6c63ff;
    background: linear-gradient(to right, rgba(108, 99, 255, 0.05), #fff);
}

.transaction-item.staking-transaction:hover {
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.2);
}

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

.transaction-digest {
    font-family: monospace;
    font-size: 0.85em;
    color: #666;
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.transaction-digest a {
    color: #00b8d4;
    text-decoration: none;
    transition:
        color 0.2s,
        text-decoration 0.2s;
    font-weight: 600;
}

.transaction-digest a:hover {
    color: #00e5cc;
    text-decoration: underline;
}

.transaction-digest a:visited {
    color: #00b8d4;
}

.transaction-detail-inline {
    font-size: 0.95em;
    color: #666;
}

.transaction-detail-inline strong {
    color: #131f37;
}

.transaction-timestamp {
    font-size: 0.85em;
    color: #999;
    white-space: nowrap;
}

.transaction-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.transaction-detail {
    font-size: 0.9em;
}

.transaction-detail strong {
    color: #131f37;
}

.transaction-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.transaction-status.success {
    background: #4caf50;
    color: white;
}

.transaction-status.failure {
    background: #f44336;
    color: white;
}

.balance-changes {
    background: #f8f9fa;
    padding: 8px 10px;
    border-radius: 6px;
    margin-top: 8px;
    border-left: 3px solid #00e5cc;
}

.balance-change-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.9em;
}

.balance-change-amount {
    font-family: monospace;
    font-weight: bold;
}

.balance-change-amount.positive {
    color: #4caf50;
}

.balance-change-amount.negative {
    color: #f44336;
}

.balance-change-amount.neutral {
    color: #666;
}

.balance-change-owner {
    font-family: monospace;
    font-size: 0.75em;
    color: #666;
    word-break: break-all;
}

.transaction-type {
    font-size: 0.85em;
    color: #00b8d4;
    font-weight: 600;
}

.gas-used {
    color: #ff9800;
    font-weight: 600;
}

.transactions-loading {
    text-align: center;
    padding: 20px;
    color: #00e5cc;
    font-size: 0.95em;
}

.no-transactions {
    text-align: center;
    padding: 30px;
    color: #999;
    font-style: italic;
}

@media (max-width: 600px) {
    .header h1 {
        font-size: 1.8em;
    }

    .mode-selector {
        flex-direction: column;
        gap: 10px;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group-multi > div {
        flex-direction: column;
    }

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

    .transaction-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .transaction-digest {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .transaction-details {
        grid-template-columns: 1fr;
    }

    .address-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Modal styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 10px 40px rgba(0, 229, 204, 0.3);
    animation: slideDown 0.3s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #e8f5f3 0%, #d4edea 100%);
    border-radius: 15px 15px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #131f37;
    font-size: 1.5em;
}

.modal-close {
    color: #666;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition:
        background 0.3s,
        color 0.3s;
}

.modal-close:hover {
    background: rgba(0, 229, 204, 0.2);
    color: #00b8d4;
}

.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.breakdown-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid #00e5cc;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.breakdown-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 229, 204, 0.2);
}

.breakdown-address {
    font-family: monospace;
    font-size: 0.85em;
    color: #666;
    margin-bottom: 12px;
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 10px;
}

.breakdown-address .address-number {
    background: #00e5cc;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9em;
    min-width: 40px;
    text-align: center;
}

.breakdown-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.breakdown-stat {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.breakdown-stat-label {
    font-size: 0.8em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.breakdown-stat-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #131f37;
}

.breakdown-stat-fiat {
    font-size: 0.9em;
    color: #00b8d4;
    margin-top: 3px;
}

.clickable-stat {
    cursor: pointer !important;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.clickable-stat .stat-label,
.clickable-stat .stat-value,
.clickable-stat .stat-fiat {
    pointer-events: none;
}

.clickable-stat:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 10px 30px rgba(0, 229, 204, 0.5);
}

.clickable-stat::after {
    content: "🔍 Click for details";
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.75em;
    opacity: 0;
    transition: opacity 0.3s;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 6px;
    color: #00b8d4;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.clickable-stat:hover::after {
    opacity: 1;
}

.clickable-stat:active {
    transform: translateY(-3px) scale(1.01);
}

@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-body {
        padding: 20px;
        max-height: 60vh;
    }

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