/* Base Styles */
:root {
    --bg-color: var(--bg-primary, #0b0f19);
    --card-bg: var(--bg-card, linear-gradient(145deg, #111827, #0f172a));
    --card-border: var(--purple-border, #1e293b);
    --text-main: var(--text-primary, #f8fafc);
    --text-muted: var(--text-secondary, #94a3b8);
    --neon-green: var(--gold-light, #00ffaa); 
    --neon-alert: var(--status-neg, #ff5f56);
    --font-family: var(--font-family, 'Inter', sans-serif);
}

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

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

button, input, select, textarea {
    font-family: inherit;
}

/* Background Animated Gradient Mesh */
.background-effect {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(0, 255, 170, 0.05) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
    animation: drift 20s infinite linear;
}
@keyframes drift { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Layout Grid */
.dashboard-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Glassmorphism Panel */
.glass-panel {
    background: rgba(19, 19, 31, 0.65); /* var(--bg-card) with transparency */
    backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 255, 170, 0.15);
    transition: all 0.3s ease;
}

/* Sidebar */
.sidebar {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    border-right-width: 1px;
    border-right-color: rgba(0, 255, 170, 0.2);
    border-right-style: solid;
    border-top: none;
    border-bottom: none;
    border-left: none;
    border-radius: 0 24px 24px 0; /* Bo góc phải */
}
.logo { font-weight: 800; color: var(--neon-green); font-size: 1.8rem; margin-bottom: 0.2rem; }
.dnt-logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--neon-green, #00FFAA);
    text-shadow: 0 0 10px rgba(0, 255, 170, 0.5), 0 0 20px rgba(0, 255, 170, 0.3);
    text-decoration: none;
    letter-spacing: 1px;
}
.subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }

/* Nav item styles (used by script.js for tab switching) */
.nav-item {
    text-decoration: none;
    color: #fff;
    opacity: 0.8;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.2s;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}
.nav-item:hover, .nav-item.active {
    opacity: 1;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    border-bottom: 2px solid var(--purple-glow, #66FFC2);
}



.user-inputs h3 { font-size: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--card-border); padding-bottom: 0.5rem; }
.input-group { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.3rem;}
.input-group label { font-size: 0.85rem; color: var(--text-muted); }

/* Gen-Z Input Styles */
.glass-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-family: inherit;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
}
.glass-input:focus {
    border-color: var(--neon-green);
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.2);
}

/* Select dropdown styling for dark theme */
select.glass-input {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
select.glass-input option {
    background-color: #1e293b;
    color: #f8fafc;
    padding: 8px 12px;
    border: none;
}
select.glass-input option:hover,
select.glass-input option:checked {
    background-color: #334155;
    color: #00ffaa;
}

.action-btn {
    margin-top: 1rem;
    background: var(--purple-core, #7C3AED);
    color: white;
    font-weight: 600;
    font-family: inherit;
    border: none;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(124, 58, 237, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}
.action-btn:hover {
    background: var(--purple-soft, #6D28D9);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}
.action-btn:active { transform: translateY(0); }

.footer-text { margin-top: auto; font-size: 0.8rem; color: var(--text-muted); text-align: center; }

/* Main Content */
.main-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-radius: 12px;
}

.status-indicator { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.9rem; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; }
.status-dot.green { background: var(--neon-green); box-shadow: 0 0 8px var(--neon-green); }

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}
.card {
    padding: 2rem;
    border-radius: 16px;
}
.card:hover {
    border-color: rgba(0, 255, 170, 0.3);
    box-shadow: 0 8px 30px rgba(0,0,0, 0.5);
    transform: translateY(-5px);
}
.card.span-2 { grid-column: span 2; }
.caption { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }

.metric-card { text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.metric-card h4 { color: var(--text-muted); font-size: 1rem; margin-bottom: 0.5rem; }
.neon-text { font-size: 2.5rem; color: var(--neon-green); text-shadow: 0 0 10px rgba(0, 255, 170, 0.4); }
.neon-alert { font-size: 2.5rem; color: var(--neon-alert); text-shadow: 0 0 10px rgba(255, 85, 85, 0.4); }

/* ═══════════════════════════════════════════════════
   AI ADVICE PANEL
═══════════════════════════════════════════════════ */

.ai-advice-card {
    border: 1px solid rgba(139, 92, 246, 0.3);
    background: linear-gradient(145deg, #0f0c1a, #130f22);
    transition: all 0.4s ease;
    animation: ai-card-appear 0.5s ease both;
}

@keyframes ai-card-appear {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ai-advice-card:hover {
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 8px 40px rgba(139, 92, 246, 0.2);
    transform: translateY(-3px);
}

/* Header */
.ai-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.ai-panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.ai-gem-icon {
    color: #a78bfa;
    font-size: 1.2rem;
    animation: gem-pulse 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes gem-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.2); opacity: 0.7; }
}

/* Status Badge */
.ai-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.78rem;
    color: #a78bfa;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.ai-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #a78bfa;
    animation: badge-blink 1.2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes badge-blink {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px #a78bfa; }
    50%       { opacity: 0.3; box-shadow: none; }
}

.ai-badge.done {
    background: rgba(0, 255, 170, 0.1);
    border-color: rgba(0, 255, 170, 0.3);
    color: var(--neon-green);
}
.ai-badge.done .ai-badge-dot {
    background: var(--neon-green);
    animation: none;
    box-shadow: 0 0 6px var(--neon-green);
}

/* Divider */
.ai-divider {
    height: 1px;
    background: linear-gradient(to right, rgba(139, 92, 246, 0.5), transparent);
    margin-bottom: 1.2rem;
}

/* Body / Loading */
.ai-body { min-height: 80px; }

.ai-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 1rem 0;
}

.ai-loading-dots {
    display: flex;
    gap: 5px;
}

.ai-loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a78bfa;
    animation: dot-bounce 1.4s ease-in-out infinite both;
}
.ai-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%           { transform: scale(1.1); opacity: 1; }
}

/* AI Text Content */
.ai-text {
    color: #cbd5e1;
    line-height: 1.85;
    font-size: 0.95rem;
    white-space: pre-wrap;
}

.ai-text strong { color: #e2e8f0; font-weight: 700; }
.ai-text em     { color: #a78bfa; }
.ai-text h2, .ai-text h3, .ai-text h4 { color: #f1f5f9; margin: 1rem 0 0.4rem; }
.ai-text ul, .ai-text ol { margin: 0.3rem 0 0.3rem 1.2rem; }
.ai-text li { margin-bottom: 0.2rem; }
.ai-text hr  { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 1rem 0; }
.ai-text blockquote {
    border-left: 3px solid rgba(139, 92, 246, 0.5);
    padding-left: 1rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 0.5rem 0;
}

/* Blinking cursor while streaming */
.ai-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #a78bfa;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursor-blink 0.7s step-end infinite;
}

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


/* Welcome screen inside chart container */
.welcome-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    padding: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}
.welcome-icon {
    font-size: 3rem;
    color: var(--neon-green);
    margin-bottom: 1rem;
    opacity: 0.5;
    animation: gem-pulse 3s infinite;
}
.welcome-container h4 {
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.welcome-container p {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 400px;
}

/* ═══════════════════════════════════════════════════
   TRADING SIGNALS BADGES & CTA
═══════════════════════════════════════════════════ */
.signal-badge {
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    text-transform: uppercase;
}
.badge-buy {
    background-color: rgba(0, 255, 170, 0.1);
    color: #00FFAA;
    border: 1px solid rgba(0, 255, 170, 0.3);
}
.badge-sell {
    background-color: rgba(255, 85, 85, 0.1);
    color: #FF5555;
    border: 1px solid rgba(255, 85, 85, 0.3);
}
.badge-hold {
    background-color: rgba(148, 163, 184, 0.1);
    color: #94A3B8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.btn-vps-cta {
    background: linear-gradient(90deg, #F59E0B 0%, #D97706 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
    transition: all 0.3s ease;
    display: inline-block;
}
.btn-vps-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
    color: white;
}

/* ═══════════════════════════════════════════════════
   TA MODAL
═══════════════════════════════════════════════════ */
.ta-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.ta-modal-content {
    background: #111827;
    border: 1px solid rgba(0, 255, 170, 0.3);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    color: white;
}

.ta-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.ta-modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.ta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ta-box {
    background: rgba(255,255,255,0.03);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.ta-box span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(0, 255, 170, 0.2);
        border-radius: 0;
        padding: 1.5rem;
    }
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .card.span-2 {
        grid-column: span 1;
    }
    .top-nav {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }
    .top-nav > div {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    .main-content {
        padding: 1rem;
        gap: 1.5rem;
    }
    .card {
        padding: 1.5rem;
    }
    .neon-text, .neon-alert {
        font-size: 2rem;
    }
    .ta-modal-content {
        width: 95%;
        max-width: 100%;
        padding: 15px;
    }
    .ta-grid {
        grid-template-columns: 1fr;
    }
}
