/* Balanced Black & White Minimalist Theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    background: #ffffff;
    color: #000000;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header - White */
.main-header {
    text-align: center;
    padding: 50px 40px;
    background: #ffffff;
    color: #000000;
    margin-bottom: 0;
    position: relative;
    border-bottom: 2px solid #f0f0f0;
}

.main-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: #000;
}

.ascii-logo {
    font-family: monospace;
    font-size: 14px;
    line-height: 1.2;
    margin: 0;
    padding: 0;
    color: #000;
    font-weight: bold;
    white-space: pre;
    overflow-x: auto;
}

.subtitle {
    color: #666;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: none;
    margin-bottom: 15px;
}

.social-links {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid #000;
    transition: all 0.2s ease;
    text-transform: none;
}

.social-link:hover {
    background: #fff;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.social-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Search Container - Centered */
.search-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 300px);
    padding: 40px 20px;
}

.search-box {
    background: #ffffff;
    border: 3px solid #000000;
    padding: 50px 60px;
    max-width: 600px;
    width: 100%;
    box-shadow: 10px 10px 0 #000000;
}

.search-header {
    text-align: center;
    margin-bottom: 40px;
}

.search-label {
    font-size: 11px;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 3px;
    display: inline-block;
    opacity: 0.6;
}

.search-divider {
    width: 60px;
    height: 2px;
    background: #000;
    margin: 15px auto;
}

.search-subtitle {
    font-size: 24px;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}

.search-input-wrapper {
    display: flex;
    gap: 0;
}

.search-input {
    flex: 1;
    padding: 20px 24px;
    border: 2px solid #000000;
    border-right: none;
    font-size: 16px;
    font-family: 'Monaco', 'Courier New', monospace;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #000000;
}

.search-input:focus {
    outline: none;
    background: #f5f5f5;
}

.search-input::placeholder {
    color: #bbb;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.search-button {
    padding: 20px;
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.search-button.icon-only {
    width: 64px;
    padding: 20px;
}

.search-button:hover {
    background: #ffffff;
    color: #000000;
}

.search-button:active {
    transform: scale(0.98);
}

.search-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.search-icon, .loader-icon {
    transition: transform 0.2s ease;
}

.search-button:hover .search-icon {
    transform: scale(1.1);
}

/* Rotating loader animation */
.loader-icon {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Progress Bar Styles */
.progress-container {
    margin-top: 30px;
    padding: 20px;
    background: #f5f5f5;
    border: 2px solid #000000;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #ffffff;
    border: 2px solid #000000;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #000000;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    margin-top: 15px;
    font-size: 14px;
    color: #000000;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.progress-percent {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 18px;
    font-weight: 700;
    color: #000000;
}

/* Analysis Results Container */
.analysis-results {
    position: relative;
}

/* New Analysis Button - Fixed Position */
.new-analysis-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 12px 24px;
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.new-analysis-btn:hover {
    background: #ffffff;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.new-analysis-btn svg {
    width: 16px;
    height: 16px;
}

/* Hide old input section */
.input-section {
    display: none;
}

/* Status Messages */
.status {
    margin-top: 24px;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status.loading {
    background: #f5f5f5;
    color: #000000;
    border-left: 4px solid #000000;
}

.status.success {
    background: #000000;
    color: #ffffff;
}

.status.error {
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
}

/* Stats Grid - Alternating black and white */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
    margin-bottom: 40px;
    border: 3px solid #000000;
}

.stat-card {
    padding: 30px 24px;
    transition: all 0.2s ease;
    position: relative;
}

.stat-card:nth-child(odd) {
    background: #000000;
    color: #ffffff;
}

.stat-card:nth-child(even) {
    background: #ffffff;
    color: #000000;
    border: 1px solid #000000;
}

.stat-card:hover {
    transform: scale(1.02);
    z-index: 10;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.7;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

.stat-card.risk .stat-value[data-risk="LOW"] {
    color: inherit;
}

.stat-card.risk .stat-value[data-risk="MEDIUM"] {
    color: inherit;
    text-decoration: underline;
}

.stat-card.risk .stat-value[data-risk="HIGH"] {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 3px;
}

.risk-score {
    font-size: 11px;
    margin-top: 8px;
    opacity: 0.7;
}

/* Visualization Container - Black frame */
.visualization-container {
    background: #ffffff;
    border: 3px solid #000000;
    overflow: hidden;
    margin-bottom: 40px;
    position: relative;
}

/* Network Header with Toggle */
.network-header {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: #ffffff;
    border: 2px solid #000000;
    padding: 8px;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.toggle-btn {
    padding: 8px 16px;
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-btn:not(:last-child) {
    border-right: none;
}

.toggle-btn.active {
    background: #000000;
    color: #ffffff;
}

.toggle-btn:hover:not(.active) {
    background: #f5f5f5;
}

#network {
    width: 100%;
    height: 600px;
    background: 
        repeating-linear-gradient(
            0deg,
            #ffffff,
            #ffffff 20px,
            #f9f9f9 20px,
            #f9f9f9 40px
        );
}

/* Controls - Black and white buttons */
.controls {
    padding: 24px;
    background: #000000;
    display: flex;
    gap: 16px;
    justify-content: center;
}

.controls button {
    padding: 12px 24px;
    background: #ffffff;
    color: #000000;
    border: 2px solid #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.controls button:hover {
    background: #000000;
    color: #ffffff;
}

/* Legend - Striped pattern */
.legend {
    background: #ffffff;
    padding: 32px;
    border: 3px solid #000000;
    position: relative;
}

.legend::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: repeating-linear-gradient(
        90deg,
        #000000,
        #000000 10px,
        #ffffff 10px,
        #ffffff 20px
    );
}

.legend-title {
    font-size: 18px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #000000;
    font-weight: 500;
}

.legend-color {
    width: 28px;
    height: 28px;
    border: 2px solid #000000;
}

/* Popup Overlay */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.popup-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-content {
    background: #ffffff;
    border: 3px solid #000000;
    width: 90%;
    max-width: 500px;
    box-shadow: 
        8px 8px 0 #000000,
        16px 16px 0 #ffffff,
        16px 16px 0 0 3px #000000;
}

.popup-header {
    padding: 24px;
    background: #000000;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h3 {
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.popup-close {
    background: none;
    border: 2px solid #ffffff;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.popup-close:hover {
    background: #ffffff;
    color: #000000;
}

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

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #000000;
}

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

.detail-label {
    font-weight: 600;
    color: #000000;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-value {
    font-weight: 500;
    color: #000000;
    font-size: 14px;
    text-align: right;
}

.detail-value.address {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
}

.tx-link {
    color: #000000;
    text-decoration: underline;
    transition: all 0.2s ease;
}

.tx-link:hover {
    text-decoration-thickness: 2px;
}

.popup-tabs {
    display: flex;
    gap: 10px;
    padding: 10px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.tab-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.tab-btn:hover:not(.active) {
    background: #e0e0e0;
}

.popup-footer {
    padding: 24px;
    background: #f5f5f5;
    border-top: 2px solid #000000;
    display: flex;
    justify-content: flex-end;
}

.view-explorer-btn {
    padding: 12px 32px;
    background: #000000;
    color: #ffffff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.view-explorer-btn:hover {
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
}

/* Loading Animation */
.loading::after {
    content: '...';
    display: inline-block;
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #ffffff;
    border: 1px solid #000000;
}

::-webkit-scrollbar-thumb {
    background: #000000;
    border: 2px solid #ffffff;
}

::-webkit-scrollbar-thumb:hover {
    background: #333333;
}

/* Focus styles */
*:focus-visible {
    outline: 3px solid #000000;
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .main-header {
        padding: 30px 20px;
    }
    
    .ascii-logo {
        font-size: 8px;
        line-height: 1;
    }
    
    .subtitle {
        font-size: 12px;
    }
    
    .social-link {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .social-link svg {
        width: 16px;
        height: 16px;
    }
    
    .search-container {
        min-height: calc(100vh - 250px);
        padding: 30px 15px;
    }
    
    .search-box {
        padding: 35px 30px;
        box-shadow: 6px 6px 0 #000000;
    }
    
    .search-subtitle {
        font-size: 18px;
        letter-spacing: 1.5px;
    }
    
    .search-label {
        font-size: 10px;
        letter-spacing: 2px;
    }
    
    .search-divider {
        width: 40px;
        margin: 12px auto;
    }
    
    .search-input-wrapper {
        flex-direction: column;
    }
    
    .search-input {
        border-right: 2px solid #000000;
        border-bottom: none;
        font-size: 14px;
    }
    
    .search-button.icon-only {
        width: 100%;
        border-top: none;
        justify-content: center;
        padding: 16px;
    }
    
    .new-analysis-btn {
        top: 10px;
        right: 10px;
        padding: 10px 20px;
        font-size: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    #network {
        height: 400px;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    #tokenAddress {
        border-right: 2px solid #000000;
        border-bottom: none;
    }
    
    #analyzeBtn {
        width: 100%;
        border-top: none;
    }
    
    #network {
        height: 400px;
    }
    
    .controls {
        flex-wrap: wrap;
    }
    
    .controls button {
        flex: 1;
        min-width: 120px;
    }
    
    .popup-body {
        max-height: 50vh;
    }
    
    .legend {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        padding: 10px;
    }
    
    .legend-title {
        font-size: 12px;
        margin-bottom: 5px;
    }
    
    .legend-items {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px;
        font-size: 10px;
    }
    
    .legend-item {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .legend-color {
        flex-shrink: 0;
        width: 12px;
        height: 12px;
    }
    
    .tab-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .ascii-logo {
        font-size: 5px;
        line-height: 0.9;
    }
    
    .social-link {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .social-link svg {
        width: 14px;
        height: 14px;
    }
    
    .search-box {
        padding: 30px 25px;
        box-shadow: 5px 5px 0 #000000;
    }
    
    .search-subtitle {
        font-size: 16px;
        letter-spacing: 1px;
    }
    
    .search-label {
        font-size: 9px;
        letter-spacing: 1.5px;
    }
    
    .search-header {
        margin-bottom: 30px;
    }
    
    .search-input {
        padding: 16px 20px;
        font-size: 13px;
    }
    
    .search-button {
        padding: 16px 30px;
        font-size: 13px;
    }
    
    .new-analysis-btn {
        padding: 8px 16px;
        font-size: 11px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card.risk {
        grid-column: span 1;
    }
    
    .legend {
        position: relative;
        bottom: auto;
        right: auto;
        left: auto;
        margin-top: 20px;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid #ddd;
    }
    
    .legend-items {
        grid-template-columns: 1fr;
        gap: 3px;
    }
    
    .legend-item span:last-child {
        font-size: 9px;
    }
}