/* JunoCash Explorer - Modern UI Styles */

:root {
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #222240;
    --accent: #252542;
    --accent-light: #2d2d4a;
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --transparent-color: #22c55e;
    --shielded-color: #3b82f6;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --gradient-success: linear-gradient(135deg, #22c55e 0%, #14b8a6 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
header {
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(26, 26, 46, 0.95) 100%);
    padding: 16px 0;
    border-bottom: 1px solid var(--accent);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    flex-shrink: 0;
}

.logo svg {
    display: block;
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.3));
}

.brand-text {
    display: flex;
    flex-direction: column;
}

header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
}

header h1 a {
    color: var(--text);
    text-decoration: none;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header h1 a:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}


/* Header Links */
.header-links {
    display: flex;
    gap: 12px;
}

.pool-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pool-link svg {
    opacity: 0.7;
}

.pool-link:hover {
    color: var(--text);
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    text-decoration: none;
}

.pool-link:hover svg {
    opacity: 1;
}

/* Network Switcher - Same as Pool */
.network-switcher {
    display: flex;
    gap: 4px;
    background: var(--accent);
    padding: 4px;
    border-radius: var(--radius-md);
}

.network-link {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.network-link.mainnet {
    color: var(--text-dim);
}

.network-link.mainnet:hover {
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.network-link.mainnet.active {
    color: var(--success);
    background: rgba(34, 197, 94, 0.2);
}

.network-link.testnet {
    color: var(--text-dim);
}

.network-link.testnet:hover {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.network-link.testnet.active {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.2);
}


/* Sync Status */
.sync-status {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
    background: var(--accent);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
}

.sync-info {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.sync-label {
    color: var(--text-dim);
}

.sync-bar-container {
    height: 4px;
    background: var(--bg-dark);
    border-radius: 2px;
    overflow: hidden;
}

.sync-bar {
    height: 100%;
    background: var(--gradient-success);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.sync-status.synced .sync-bar {
    background: var(--success);
}

.sync-status.synced .sync-info {
    color: var(--success);
}

.sync-status.syncing .sync-bar {
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Navigation - Same style as Pool */
nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--accent);
    padding: 8px 0;
}

nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-links {
    display: flex;
    gap: 4px;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
}

nav a:hover {
    color: var(--text);
    background: var(--accent);
}

nav a.active {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.15);
}

/* Nav Search */
.nav-search {
    display: flex;
    gap: 8px;
    padding: 8px 0;
}

.nav-search input {
    width: 280px;
    padding: 8px 14px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    background: var(--bg-dark);
    color: var(--text);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.nav-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.nav-search input::placeholder {
    color: var(--text-dim);
}

.nav-search button {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.nav-search button:hover {
    background: var(--primary-dark);
}

/* Main Content */
main {
    padding: 32px 0;
    min-height: calc(100vh - 200px);
}

/* Pages */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--accent);
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.stat-card p {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    word-break: break-word;
    line-height: 1.2;
}

/* Supply Breakdown */
.supply-breakdown {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-md);
    margin-bottom: 32px;
    border: 1px solid var(--accent);
}

.supply-breakdown h3 {
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

.supply-bar {
    height: 12px;
    background: var(--accent);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
}

.supply-bar .transparent {
    background: linear-gradient(90deg, #22c55e 0%, #14b8a6 100%);
    transition: width 0.5s ease;
}

.supply-bar .shielded {
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    transition: width 0.5s ease;
}

.supply-legend {
    display: flex;
    gap: 40px;
    margin-top: 16px;
    font-size: 0.9rem;
}

.supply-legend span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.supply-legend span.transparent::before,
.supply-legend span.shielded::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.supply-legend span.transparent::before {
    background: linear-gradient(135deg, #22c55e 0%, #14b8a6 100%);
}

.supply-legend span.shielded::before {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}

/* Two Columns */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .two-columns {
        grid-template-columns: 1fr;
    }
}

.column {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--accent);
}

.column h2 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.column h2::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 16px;
    text-align: left;
}

th {
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--accent);
}

td {
    font-size: 0.9rem;
    border-bottom: 1px solid var(--accent);
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: var(--bg-card-hover);
}

tbody tr:last-child td {
    border-bottom: none;
}

.full-table {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--accent);
}

/* Detail Card */
.detail-card {
    background: var(--bg-card);
    padding: 28px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border: 1px solid var(--accent);
}

.detail-table th {
    width: 160px;
    color: var(--text-dim);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.detail-table td {
    word-break: break-all;
    font-family: 'JetBrains Mono', 'Monaco', monospace;
    font-size: 0.85rem;
}

/* Transaction I/O */
.tx-io {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    margin-top: 24px;
}

.tx-io .inputs, .tx-io .outputs {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--accent);
}

.tx-io h3 {
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.tx-io .arrow {
    display: flex;
    align-items: center;
    font-size: 2rem;
    color: var(--primary);
    opacity: 0.7;
}

.io-item {
    padding: 14px 16px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 0.85rem;
    transition: background 0.15s ease;
}

.io-item:hover {
    background: var(--accent-light);
}

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

.io-item .address {
    word-break: break-all;
    margin-bottom: 6px;
    font-family: 'JetBrains Mono', 'Monaco', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.io-item .value {
    color: var(--success);
    font-weight: 600;
    font-size: 0.9rem;
}

.io-item.spent .value {
    color: var(--secondary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.pagination button {
    padding: 12px 32px;
    background: var(--accent);
    color: var(--text);
    border: 1px solid var(--accent-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Links */
a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary);
}

.mono {
    font-family: 'JetBrains Mono', 'Monaco', monospace;
    font-size: 0.85rem;
}

/* Note */
.note {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

/* Footer */
footer {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-dark) 100%);
    border-top: 1px solid var(--accent);
    padding: 32px 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.footer-donate {
    text-align: center;
    background: var(--accent);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--accent-light);
    width: 100%;
    max-width: 800px;
}

.footer-donate h4 {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.donate-address {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.donate-address code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--primary-light);
    background: var(--bg-dark);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent);
    word-break: break-all;
    max-width: 100%;
}

.copy-btn-small {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-btn-small:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.copy-btn-small svg {
    flex-shrink: 0;
}

.footer-credits {
    text-align: center;
}

.footer-credits p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-credits a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.footer-credits a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-links .separator {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-wrap: wrap;
        gap: 16px;
    }

    .header-brand {
        flex: 1;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px;
    }

    .tagline {
        display: none;
    }

    .nav-search {
        display: none;
    }

    .sync-status {
        min-width: auto;
    }

    .network-switcher {
        justify-content: center;
    }

    .footer-donate {
        padding: 16px;
    }

    .donate-address {
        flex-direction: column;
        text-align: center;
    }

    .donate-address code {
        font-size: 0.65rem;
    }
}

@media (max-width: 600px) {
    .tx-io {
        grid-template-columns: 1fr;
    }

    .tx-io .arrow {
        transform: rotate(90deg);
        justify-content: center;
        padding: 10px 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    nav .container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 24px;
    }

    .nav-links {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    nav a {
        padding: 8px 16px;
        white-space: nowrap;
    }

    .nav-search {
        display: flex;
    }

    .nav-search input {
        flex: 1;
        width: auto;
    }
}

/* Type badges */
.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.coinbase {
    background: linear-gradient(135deg, #22c55e 0%, #14b8a6 100%);
    color: white;
}

.badge.shielded {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
}

.badge.transparent {
    background: var(--accent);
    color: var(--text-muted);
}

.badge.receive {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge.send {
    background: rgba(236, 72, 153, 0.15);
    color: var(--secondary);
    border: 1px solid rgba(236, 72, 153, 0.3);
}

h2 {
    margin-bottom: 24px;
    font-weight: 600;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

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

/* Tooltip */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--bg-dark);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    border: 1px solid var(--accent);
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-light);
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}

/* Emission info card for slow start */
.emission-info {
    background: linear-gradient(135deg, var(--accent) 0%, var(--bg-card) 100%);
    padding: 20px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border: 1px solid var(--accent-light);
    display: flex;
    align-items: center;
    gap: 16px;
}

.emission-info .icon {
    font-size: 2rem;
}

.emission-info .content {
    flex: 1;
}

.emission-info .title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.emission-info .description {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.emission-info .progress {
    text-align: right;
}

.emission-info .progress-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
}

.emission-info .progress-label {
    font-size: 0.75rem;
    color: var(--text-dim);
}
