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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d30 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

.header {
    text-align: center;
    padding: 2rem 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.input-section {
    margin-bottom: 2rem;
}

.input-container {
    background: rgba(45, 45, 48, 0.9);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-container label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #e0e0e0;
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

#txid-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #444;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: rgba(60, 60, 64, 0.8);
    color: #e0e0e0;
}

#txid-input:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.2);
}

.btn-primary, .btn-secondary {
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 120, 212, 0.4);
}

.btn-secondary {
    background: rgba(60, 60, 64, 0.8);
    color: #e0e0e0;
    border: 2px solid #444;
}

.btn-secondary:hover {
    background: rgba(80, 80, 84, 0.9);
    transform: translateY(-1px);
}

.error-message {
    color: #e74c3c;
    background: #ffeaea;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
}

.analysis-section {
    margin-bottom: 2rem;
}

.analysis-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    min-height: 600px;
}

.timeline-container {
    background: rgba(45, 45, 48, 0.9);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-container h2 {
    margin-bottom: 1rem;
    color: #e0e0e0;
}

.graph-container {
    background: rgba(45, 45, 48, 0.9);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.graph-container h2 {
    margin-bottom: 1rem;
    color: #e0e0e0;
}

#graph-visualization {
    width: 100%;
    height: 500px;
    border: 2px solid #444;
    border-radius: 10px;
    margin-bottom: 1rem;
    min-width: 1000px;
    background: rgba(20, 20, 22, 0.5);
}

.graph-controls {
    display: flex;
    gap: 1rem;
}

.overview-container {
    background: rgba(45, 45, 48, 0.9);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.overview-container h2 {
    margin-bottom: 1rem;
    color: #e0e0e0;
}

.transaction-overview {
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid #444;
    border-radius: 10px;
    padding: 1rem;
    background: rgba(20, 20, 22, 0.3);
}

/* Custom scrollbar for transaction overview */
.transaction-overview::-webkit-scrollbar {
    width: 8px;
}

.transaction-overview::-webkit-scrollbar-track {
    background: rgba(30, 30, 32, 0.5);
    border-radius: 4px;
}

.transaction-overview::-webkit-scrollbar-thumb {
    background: rgba(0, 120, 212, 0.6);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.transaction-overview::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 120, 212, 0.8);
}

.transaction-overview::-webkit-scrollbar-thumb:active {
    background: rgba(0, 120, 212, 1);
}

/* Firefox scrollbar */
.transaction-overview {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 120, 212, 0.6) rgba(30, 30, 32, 0.5);
}

.transaction-card {
    display: block;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid #444;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(60, 60, 64, 0.6);
    min-height: 80px;
}

.transaction-card:hover {
    background: rgba(80, 80, 84, 0.8);
    border-color: #0078d4;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.2);
}

.transaction-card.selected {
    background: rgba(0, 120, 212, 0.2);
    border-color: #0078d4;
    border-width: 2px;
}

.transaction-card.origin-transaction {
    background: #fff3cd !important;
    border-color: #ffc107 !important;
    border-width: 3px !important;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4) !important;
    position: relative;
}

.transaction-card.origin-transaction::before {
    content: "ORIGIN";
    position: absolute;
    top: -8px;
    right: 8px;
    background: #ffc107;
    color: #000;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 1;
}

.transaction-card.origin-transaction.selected {
    background: rgba(0, 120, 212, 0.3);
    border-color: #0078d4;
    border-width: 2px;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.4);
}

.transaction-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.transaction-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.transaction-date {
    font-weight: 600;
    color: #e0e0e0;
}

.transaction-type {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.transaction-type.received {
    background: #d4edda;
    color: #155724;
}

.transaction-type.sent {
    background: #f8d7da;
    color: #721c24;
}

.transaction-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #b0b0b0;
}

.transaction-amount {
    font-weight: 600;
    font-size: 1rem;
}

.transaction-amount.positive {
    color: #27ae60;
}

.transaction-amount.negative {
    color: #e74c3c;
}

.transaction-balance {
    font-size: 0.85rem;
    color: #a0a0a0;
}

.transaction-id-container {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.transaction-id {
    font-family: monospace;
    font-size: 0.75rem;
    color: #a0a0a0;
    word-break: break-all;
    line-height: 1.2;
    flex: 0 1 auto;
}

.copy-btn, .copy-btn-small {
    background: none;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    padding: 4px 6px;
    color: #b0b0b0;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.copy-btn {
    margin-left: 8px;
    padding: 6px 8px;
}

.copy-btn-small {
    padding: 2px 4px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 1px;
}

.copy-btn:hover, .copy-btn-small:hover {
    background: rgba(80, 80, 84, 0.8);
    border-color: #777;
    color: #e0e0e0;
}

.copy-btn:active, .copy-btn-small:active {
    background: rgba(100, 100, 104, 0.8);
    transform: scale(0.95);
}

.copy-btn svg, .copy-btn-small svg {
    display: block;
}

.txid-display {
    font-family: monospace;
    font-size: 0.9rem;
    background: rgba(60, 60, 64, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-all;
    color: #e0e0e0;
}


.timeline-section {
    background: rgba(45, 45, 48, 0.9);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-section h2 {
    margin-bottom: 1rem;
    color: #e0e0e0;
}

.address-summary-info {
    margin-bottom: 1rem;
    padding: 0.75rem 0;
}

.address-summary-line {
    color: #b0b0b0;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

#timeline-visualization {
    width: 100%;
    height: 400px;
    border: 2px solid #444;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(20, 20, 22, 0.5);
}

.footer {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.footer .copyright {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.footer .copyright a {
    color: #0078d4;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer .copyright a:hover {
    color: #40a6ff;
    text-decoration: underline;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #444;
    border-top: 2px solid #0078d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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


@media (max-width: 1024px) {
    .input-group {
        flex-direction: column;
    }
    
    .graph-controls {
        flex-direction: column;
    }
    
    .analysis-container {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .input-container, .graph-container {
        padding: 1rem;
    }
    
    #graph-visualization {
        height: 400px;
    }
}