@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

:root {
    --bg-primary: #05080f;
    --bg-secondary: #0a0e17;
    --bg-card: rgba(10, 20, 30, 0.85);
    --bg-hover: rgba(0, 240, 255, 0.05);
    --cyan: #00f0ff;
    --cyan-dim: rgba(0, 240, 255, 0.3);
    --cyan-glow: rgba(0, 240, 255, 0.15);
    --orange: #ffaa00;
    --red: #ff3333;
    --green: #00ff88;
    --yellow: #ffdd00;
    --text-primary: #e0e0e0;
    --text-secondary: #8899aa;
    --text-dim: #556677;
    --border-color: rgba(0, 240, 255, 0.2);
    --border-glow: rgba(0, 240, 255, 0.4);
    --font-main: 'Share Tech Mono', 'Courier New', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Hex Grid Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(30deg, var(--bg-secondary) 12%, transparent 12.5%, transparent 87%, var(--bg-secondary) 87.5%, var(--bg-secondary)),
        linear-gradient(150deg, var(--bg-secondary) 12%, transparent 12.5%, transparent 87%, var(--bg-secondary) 87.5%, var(--bg-secondary)),
        linear-gradient(30deg, var(--bg-secondary) 12%, transparent 12.5%, transparent 87%, var(--bg-secondary) 87.5%, var(--bg-secondary)),
        linear-gradient(150deg, var(--bg-secondary) 12%, transparent 12.5%, transparent 87%, var(--bg-secondary) 87.5%, var(--bg-secondary)),
        linear-gradient(60deg, rgba(0, 240, 255, 0.03) 25%, transparent 25.5%, transparent 75%, rgba(0, 240, 255, 0.03) 75%, rgba(0, 240, 255, 0.03)),
        linear-gradient(60deg, rgba(0, 240, 255, 0.03) 25%, transparent 25.5%, transparent 75%, rgba(0, 240, 255, 0.03) 75%, rgba(0, 240, 255, 0.03));
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;
    z-index: -2;
}

/* Scanlines */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* Header */
.site-header {
    background: linear-gradient(180deg, rgba(5, 8, 15, 0.98) 0%, rgba(10, 20, 30, 0.95) 100%);
    border-bottom: 2px solid var(--cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan);
    animation: pulse 2s infinite;
}

.logo-text {
    font-size: 22px;
    font-weight: bold;
    color: var(--text-primary);
    text-shadow: 0 0 5px var(--cyan-dim);
    letter-spacing: 2px;
}

.main-nav {
    display: flex;
    gap: 8px;
}

.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    font-size: 14px;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.main-nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--cyan);
    transition: width 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--cyan);
    border-color: var(--cyan-dim);
    background: var(--bg-hover);
    text-shadow: 0 0 8px var(--cyan-dim);
}

.main-nav a:hover::before,
.main-nav a.active::before {
    width: 100%;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-dim);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: blink 2s infinite;
}

.status-dot.offline {
    background: var(--red);
    box-shadow: 0 0 8px var(--red);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: calc(100vh - 140px);
}

.page-title {
    font-size: 32px;
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan-dim);
    margin-bottom: 8px;
    letter-spacing: 3px;
    position: relative;
    display: inline-block;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), transparent);
}

.page-subtitle {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--cyan);
    opacity: 0.5;
}

.card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 0 20px var(--cyan-glow);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.card-icon {
    font-size: 18px;
    color: var(--cyan-dim);
}

.card-value {
    font-size: 28px;
    color: var(--text-primary);
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.card-value.small {
    font-size: 18px;
}

.card-subvalue {
    font-size: 11px;
    color: var(--text-dim);
}

.card-actual {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
    font-family: 'Courier New', monospace;
}

/* Fee Colors */
.fee-low { color: var(--green); text-shadow: 0 0 8px rgba(0, 255, 136, 0.3); }
.fee-medium { color: var(--yellow); text-shadow: 0 0 8px rgba(255, 221, 0, 0.3); }
.fee-high { color: var(--red); text-shadow: 0 0 8px rgba(255, 51, 51, 0.3); }

/* Price Colors */
.price-up { color: var(--green); }
.price-down { color: var(--red); }
.price-same { color: var(--yellow); }

/* Chart Container */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
    position: relative;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), transparent);
}

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

.chart-title {
    font-size: 18px;
    color: var(--cyan);
    letter-spacing: 2px;
}

/* Controls */
.control-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

select, button {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    font-family: var(--font-main);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

select:hover, button:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 10px var(--cyan-glow);
}

select:focus, button:focus {
    border-color: var(--cyan);
}

button {
    text-transform: uppercase;
    letter-spacing: 1px;
}

button.active {
    background: var(--cyan);
    color: var(--bg-primary);
    border-color: var(--cyan);
    box-shadow: 0 0 15px var(--cyan-dim);
}

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

/* Toggle Buttons */
.toggle-group {
    display: flex;
    gap: 5px;
}

.toggle-btn {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    background: transparent;
}

.toggle-btn.active {
    background: var(--cyan-dim);
    border-color: var(--cyan);
    color: var(--cyan);
}

/* Pairs Grid */
.pairs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.pair-tile {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pair-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
}

.pair-tile.up::before { background: var(--green); box-shadow: 0 0 10px var(--green); }
.pair-tile.down::before { background: var(--red); box-shadow: 0 0 10px var(--red); }
.pair-tile.same::before { background: var(--yellow); box-shadow: 0 0 10px var(--yellow); }

.pair-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

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

.pair-name {
    font-size: 18px;
    letter-spacing: 2px;
}

.pair-change {
    font-size: 14px;
    font-weight: bold;
}

.pair-price {
    font-size: 24px;
    margin-bottom: 15px;
}

.pair-chart {
    height: 120px;
}

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

.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, rgba(0, 240, 255, 0.05) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* Footer */
.site-footer {
    background: linear-gradient(0deg, rgba(5, 8, 15, 0.98) 0%, rgba(10, 20, 30, 0.95) 100%);
    border-top: 2px solid var(--cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
    padding: 20px;
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-section {
    display: flex;
    gap: 8px;
    font-size: 12px;
}

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

.footer-value {
    color: var(--cyan);
}

.copyright {
    color: var(--text-dim);
    margin-left: auto;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

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

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

.glitch-text:hover {
    animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: var(--cyan);
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px;
    }

    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

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

    .footer-container {
        flex-direction: column;
        text-align: center;
    }

    .copyright {
        margin-left: 0;
    }
}

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

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

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

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

/* Utility */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none !important; }

/* About Page */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 30px;
    margin-bottom: 20px;
    position: relative;
}

.about-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), transparent);
}

.about-section h2 {
    color: var(--cyan);
    margin-bottom: 15px;
    font-size: 20px;
    letter-spacing: 2px;
}

.about-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 10px;
}

.about-section ul {
    list-style: none;
    padding-left: 0;
}

.about-section ul li {
    color: var(--text-secondary);
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
}

.about-section ul li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--cyan);
}
