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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #DC143C;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    background: #FFFFFF;
    min-height: 100vh;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.header {
    background: #FFFFFF;
    color: #800020;
    padding: 20px 30px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    font-weight: 300;
}

.header-subtitle {
    opacity: 0.8;
    font-size: 0.9rem;
    margin-bottom: 15px;
    color: #800020;
}

.status-bar-connection,
.status-bar-prices {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    font-size: 0.85rem;
    background: #FFFFFF;
    padding: 8px 15px;
    border-radius: 20px;
    color: #800020;
    font-weight: 600;
    border: 2px solid #800020;
}

.status-bar-percentages-container {
    background: #FFFFFF;
    border-radius: 20px;
    color: #800020;
    font-weight: 600;
    border: 2px solid #800020;
    margin-bottom: 8px;
}

.status-bar-percentages {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    font-size: 0.85rem;
    padding: 8px 15px;
}

.legend-toggle {
    background: #FFFFFF;
    border: 2px solid #800020;
    color: #800020;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.legend-toggle:hover {
    background: #800020;
    color: #FFFFFF;
}

.legend-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.legend-content.collapsed {
    max-height: 0;
}

.status-bar-connection {
    margin-bottom: 8px;
}

.status-bar-prices {
    margin-bottom: 8px;
}

.price-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: #800020;
}

.price-value {
    color: #800020;
    font-weight: 800;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-connected {
    background: #28a745;
    animation: pulse 2s infinite;
}

.status-error {
    background: #dc3545;
}

.status-loading {
    background: #ffc107;
    animation: pulse 1s infinite;
}

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


.botnet-info {
    background: #FFFFFF;
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.botnet-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #800020;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    background: rgba(128, 0, 32, 0.1);
    border: 1px solid rgba(128, 0, 32, 0.3);
}

.botnet-link:hover {
    background: rgba(128, 0, 32, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(128, 0, 32, 0.2);
}

.analysis-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.gasmen-pending {
    opacity: 0.6;
    cursor: default;
    color: #999;
    background: rgba(153, 153, 153, 0.1);
    border: 1px solid rgba(153, 153, 153, 0.2);
}

.gasmen-pending:hover {
    transform: none;
    box-shadow: none;
    background: rgba(153, 153, 153, 0.1);
}

.new-blocks-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 200;
    background: linear-gradient(135deg, #800020 0%, #A0002A 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(128, 0, 32, 0.3);
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.new-blocks-indicator.show {
    transform: translateX(-50%) translateY(0);
}

.new-blocks-indicator:hover {
    transform: translateX(-50%) translateY(0) scale(1.05);
    box-shadow: 0 6px 25px rgba(128, 0, 32, 0.4);
}

.blocks-feed {
    padding: 0;
    background: #FFFFFF;
}

.block-card {
    background: white;
    margin: 0;
    border-left: 4px solid #800020;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

.block-card.new {
    animation: newBlockAppear 0.5s ease;
}

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

@keyframes newBlockAppear {
    0% {
        opacity: 0;
        transform: translateY(-30px);
        background: #e3f2fd;
    }
    50% {
        background: #e8f5e8;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        background: white;
    }
}

.block-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 20px 10px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    flex-wrap: wrap;
    gap: 10px;
}

.block-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.block-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
}

.block-time {
    font-size: 0.8rem;
    color: #6c757d;
}

.block-stats {
    display: flex;
    gap: 15px;
    padding: 0;
    font-size: 0.8rem;
    color: #6c757d;
    flex-wrap: wrap;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-robot {
    color: #28a745;
    font-weight: 500;
}

.transactions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
    gap: 6px;
    padding: 15px 20px 20px;
    background: white;
    min-height: 60px;
}

.transaction-emoji {
    font-size: 28px;
    text-align: center;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transaction-emoji:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.1);
    z-index: 10;
}
.transaction-emoji.failed {
    background: rgba(220, 38, 127, 0.2);
    border: 1px solid rgba(220, 38, 127, 0.4);
}
.transaction-emoji.failed:hover {
    background: rgba(220, 38, 127, 0.3);
}
.transaction-emoji.bloom-bot {
    background: #FF8C00 !important;
    border: 2px solid #FF6600 !important;
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.4);
}
.transaction-emoji.bloom-bot:hover {
    background: #FF7F00 !important;
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(255, 140, 0, 0.6);
}

.compound-emoji {
    background-color: #e6f3ff;
    border-radius: 6px;
    padding: 2px 4px;
    display: inline-block;
    font-size: 0.9em;
    line-height: 1;
}

.loading-more {
    text-align: center;
    padding: 30px;
    color: #6c757d;
    font-style: italic;
}

.loading-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    margin: 10px 20px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    animation: fadeIn 0.3s ease;
}

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

.tooltip {
    position: fixed;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    max-width: 280px;
    word-wrap: break-word;
}

.tooltip.show {
    opacity: 1;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #495057;
}

.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: scale(0);
    transition: transform 0.3s ease;
    font-size: 18px;
}

.scroll-to-top.show {
    transform: scale(1);
}

.scroll-to-top:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .app-container {
        margin: 0;
        border-radius: 0;
    }

    .header {
        padding: 10px 15px 8px;
    }

    .header h1 {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }

    .header-subtitle {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }

    .status-bar-connection {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px 15px;
        font-size: 0.7rem;
        padding: 6px 12px;
        justify-content: center;
    }

    .status-bar-percentages {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px 15px;
        font-size: 0.7rem;
        padding: 6px 12px;
        justify-content: center;
    }

    .status-bar-connection {
        margin-bottom: 6px;
    }

    .botnet-info {
        padding: 8px 15px;
    }

    .analysis-links {
        gap: 8px;
    }

    .botnet-link {
        font-size: 0.7rem;
        padding: 6px 12px;
    }

    .block-header {
        padding: 10px 15px 6px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .block-info {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
    }

    .block-stats {
        padding: 0;
        gap: 12px;
        font-size: 0.7rem;
    }

    .transactions-grid {
        grid-template-columns: repeat(auto-fill, minmax(26px, 1fr));
        gap: 3px;
        padding: 10px 15px 12px;
    }

    .transaction-emoji {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .transactions-grid {
        grid-template-columns: repeat(auto-fill, minmax(24px, 1fr));
    }

    .transaction-emoji {
        font-size: 20px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #1a1a1a;
    margin: 50px auto;
    border: 1px solid #333;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #333;
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
}

.modal-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
}

.modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

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

.modal-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #333;
}

.modal-info p {
    margin: 0;
    color: #ccc;
    font-size: 0.95rem;
}

.copy-all-btn {
    background: linear-gradient(135deg, #4a9eff, #0066cc);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.copy-all-btn:hover {
    background: linear-gradient(135deg, #5ba8ff, #0077dd);
    transform: translateY(-1px);
}

.address-list {
    display: grid;
    gap: 8px;
}

.address-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2a2a2a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.address-item:hover {
    border-color: #555;
    background-color: #333;
}

.address-text {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 0.85rem;
    color: #7ec8ff;
    word-break: break-all;
    flex: 1;
    margin-right: 12px;
}

.address-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    border: 1px solid #555;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #777;
    color: #fff;
}

.copy-btn {
    background: rgba(126, 200, 255, 0.2);
    border-color: #7ec8ff;
    color: #7ec8ff;
}

.copy-btn:hover {
    background: rgba(126, 200, 255, 0.3);
    color: #fff;
}

.snowtrace-btn {
    background: rgba(255, 165, 0, 0.2);
    border-color: #ffa500;
    color: #ffa500;
}

.snowtrace-btn:hover {
    background: rgba(255, 165, 0, 0.3);
    color: #fff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modal-content {
        margin: 20px auto;
        width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-header h2 {
        font-size: 1.2rem;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-info {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

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

    .address-text {
        margin-right: 0;
        font-size: 0.8rem;
    }

    .address-actions {
        justify-content: center;
    }
}