@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-main: #0a0a0c;
    --bg-sub: #111114;
    --border: rgba(255, 255, 255, 0.08);
    --text-main: #e4e4e7;
    --text-dim: #a1a1aa;
    --accent: #38bdf8;
    /* Sky Blue */
    --accent-glow: rgba(56, 189, 248, 0.15);
    --highlight: #10b981;
    /* Emerald */
    --warning: #f43f5e;
    /* Rose */
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Scrollable Page Override */
body.scrollable-page {
    height: auto;
    overflow-y: auto;
    display: block;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* Header - Horizontal */
.app-header {
    height: 60px;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    align-items: center;
    padding: 0 24px;
    background: var(--bg-main);
    z-index: 100;
    max-width: 1200px;
    margin: 0 auto;
}

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

.logo-icon {
    width: 28px;
    height: 28px;
    background-color: var(--accent);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3Cellipse cx='12' cy='12' rx='9' ry='3'%3E%3C/ellipse%3E%3Cellipse cx='12' cy='12' rx='9' ry='3' transform='rotate(60 12 12)'%3E%3C/ellipse%3E%3Cellipse cx='12' cy='12' rx='9' ry='3' transform='rotate(120 12 12)'%3E%3C/ellipse%3E%3C/svg%3E") no-repeat center center;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3Cellipse cx='12' cy='12' rx='9' ry='3'%3E%3C/ellipse%3E%3Cellipse cx='12' cy='12' rx='9' ry='3' transform='rotate(60 12 12)'%3E%3C/ellipse%3E%3Cellipse cx='12' cy='12' rx='9' ry='3' transform='rotate(120 12 12)'%3E%3C/ellipse%3E%3C/svg%3E") no-repeat center center;
    mask-size: contain;
    -webkit-mask-size: contain;
}

.btn-bright {
    background: var(--accent);
    color: var(--bg-main) !important;
    font-weight: 800;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
    border: none;
    transition: all 0.3s ease;
}

.btn-bright:hover {
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.6);
    transform: translateY(-2px);
}

/* Logo Animation - Blue to Purple */
@keyframes logoGradient {
    0% {
        color: #38bdf8;
    }

    50% {
        color: #a855f7;
    }

    100% {
        color: #38bdf8;
    }
}

.logo-text {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
    animation: logoGradient 5s ease-not-specified infinite;
    background: linear-gradient(135deg, #38bdf8 0%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Logo icon override removed - centralized above */

.main-nav {
    display: flex;
    gap: 32px;
    justify-content: center;
}

.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

/* Layout 3 Columns */
.app-layout {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    flex: 1;
    overflow: hidden;
}

.column {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 24px;
}

.column:last-child {
    border-right: none;
}

/* Responsive Support */
.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-main);
}

@media (max-width: 1100px) {
    .app-layout {
        grid-template-columns: 250px 1fr;
    }

    .right-col {
        display: none;
    }
}

@media (max-width: 850px) {
    .hamburger {
        display: block;
    }

    .main-nav {
        display: none;
        /* Hide by default on mobile */
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--bg-main);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border);
        gap: 20px;
    }

    .main-nav.active {
        display: flex;
    }

    .app-layout {
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    /* Đưa Sniper Alerts lên trên cùng */
    .left-col {
        order: 2;
    }

    .middle-col {
        order: 3;
    }

    .right-col {
        order: 1;
        display: flex !important;
        border-bottom: 1px solid var(--border);
    }

    .app-header {
        height: 60px;
        flex-direction: row;
        justify-content: space-between;
    }

    .column {
        border-right: none;
        height: auto;
        min-height: auto;
        overflow: visible;
        /* Show all content without inner scroll */
        padding: 20px;
    }
}

/* Fix Signal Items for 3rd Column */
.alert-card {
    background: var(--bg-sub);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 10px;
}

.alert-pair {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
}

.alert-time {
    font-size: 0.6rem;
    color: var(--text-dim);
    margin-top: 4px;
}

/* AI Architecture Flow */
.architecture-flow {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
}

.flow-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
    position: relative;
    transition: all 0.3s;
}

.flow-step:hover {
    background: rgba(56, 189, 248, 0.05);
    border-color: var(--accent);
}

.flow-step::after {
    content: '↓';
    position: absolute;
    bottom: -18px;
    left: 24px;
    color: var(--border);
    font-size: 0.8rem;
}

.flow-step:last-child::after {
    display: none;
}

.step-num {
    width: 20px;
    height: 20px;
    background: var(--bg-sub);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 800;
}

/* Detailed Alert Card */
.alert-card-detailed {
    background: var(--bg-sub);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    line-height: 1.5;
}

.alert-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.alert-section {
    margin-bottom: 12px;
}

.alert-section-title {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.price-level {
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 2px 0;
}

.level-buy {
    color: var(--highlight);
}

.level-sell {
    color: var(--warning);
}

/* Content Styling */
.section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-bottom: 20px;
}

.data-card {
    background: var(--bg-sub);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.label {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.value {
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

/* Middle Column - Intelligence */
.intelligence-node {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.node-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}

.confidence-big {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -2px;
}

.why-box {
    background: rgba(56, 189, 248, 0.03);
    border-left: 2px solid var(--accent);
    padding: 24px;
    border-radius: 0 8px 8px 0;
    margin-top: 32px;
}

.why-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.why-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
}

/* Right Column - Alerts */
.alert-item {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.alert-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Footer */
.app-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-main);
}

.disclaimer {
    font-size: 0.65rem;
    color: var(--text-dim);
    line-height: 1.6;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

/* Status Dots */
.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.dot-online {
    background: var(--highlight);
    box-shadow: 0 0 8px var(--highlight);
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

/* Transparency & Data Law Sections */
.constitution-box {
    background: rgba(16, 185, 129, 0.03);
    border: 1px solid rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    padding: 24px;
    margin-top: 32px;
}

.constitution-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--highlight);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.constitution-list {
    list-style: none;
    font-size: 0.85rem;
    color: var(--text-main);
}

.constitution-list li {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.constitution-list li::before {
    content: '◈';
    color: var(--highlight);
    font-size: 0.7rem;
}

.spec-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 8px 12px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--highlight);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.2s;
}

.spec-link:hover {
    background: var(--highlight);
    color: var(--bg-main);
}

/* Pipeline Visual (SVG/CSS) */
.visual-container {
    padding: 32px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.pipeline-step {
    padding: 12px 20px;
    background: var(--bg-sub);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    width: 240px;
    text-align: center;
    position: relative;
    border-left: 3px solid var(--border);
}

.pipeline-step.active {
    border-left-color: var(--accent);
    background: rgba(56, 189, 248, 0.05);
}

.pipeline-arrow {
    font-size: 1.2rem;
    color: var(--border);
}

/* Snapshot Section */
.snapshot-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-top: 32px;
}

.snapshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.snapshot-item {
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.snapshot-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.snapshot-value {
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
}

.json-link {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
}

.json-link:hover {
    color: var(--accent);
}

/* Dashboard Status Section */
.status-grid-compact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 16px;
}

.status-card-compact {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-label-compact {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.status-indicator-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.pulse-small {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--highlight);
    box-shadow: 0 0 8px var(--highlight);
    animation: pulse-green-small 2s infinite;
}

@keyframes pulse-green-small {
    0% {
        transform: scale(0.9);
        opacity: 1;
    }

    70% {
        transform: scale(1.2);
        opacity: 0.5;
    }

    100% {
        transform: scale(0.9);
        opacity: 1;
    }
}

/* GLOBAL FOOTER STYLES */
.app-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    padding: 80px 24px;
    margin: 100px auto 0;
    max-width: 1200px;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.75rem;
    line-height: 1.6;
}

.footer-block h4 {
    color: var(--text-main);
    margin-bottom: 16px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.footer-block p {
    margin: 0;
    opacity: 0.7;
}