:root {
    /* Base Colors */
    --bg-dark: #0B0E14;
    /* Darker than slate for pure background */
    --panel-bg: #131722;
    /* Slate dark mode */
    --panel-bg-hover: #1e2433;
    --border-color: #2a2e39;

    /* Neons & Highlights */
    --neon-green: #00ff88;
    --vivid-red: #ff3366;
    --electric-blue: #00e5ff;
    --electric-blue-muted: rgba(0, 229, 255, 0.1);
    --neon-green-muted: rgba(0, 255, 136, 0.1);
    --vivid-red-muted: rgba(255, 51, 102, 0.1);

    /* Typography */
    --text-main: #d1d4dc;
    --text-muted: #8a91a4;
    --text-white: #ffffff;

    /* Layout */
    --border-radius: 16px;
    --spacing: 20px;
    --font-family: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.is-app {
    height: 100vh;
    overflow: hidden;
}

/* Utilities */
.text-bullish {
    color: var(--neon-green);
    font-weight: 600;
}

.text-bearish {
    color: var(--vivid-red);
    font-weight: 600;
}

.text-vivid-red {
    color: var(--vivid-red);
}

.text-electric-blue {
    color: var(--electric-blue);
}

.badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge.neon-green {
    background-color: var(--neon-green-muted);
    color: var(--neon-green);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

/* Floating Panels */
.panel {
    background-color: var(--panel-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px var(--spacing);
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.panel-header h2,
.panel-header h3 {
    color: var(--text-white);
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

/* App Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
    padding: var(--spacing);
    gap: var(--spacing);
}

/* Sidebar Navigation */
.sidebar {
    width: 64px;
    background-color: var(--panel-bg);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    border: 1px solid var(--border-color);
}

.sidebar .logo {
    font-size: 28px;
    margin-bottom: 40px;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 24px;
    transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--electric-blue);
    transform: scale(1.1);
}

/* Main Workspace */
.workspace {
    display: flex;
    flex: 1;
    gap: var(--spacing);
}

/* Left: Chart Area (60%) */
.main-view {
    flex: 6;
    /* 60% relative */
    min-width: 0;
    /* allows flex shrinking */
}

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

.timeframe-selector button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: 0.2s ease;
}

.timeframe-selector button:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.05);
}

.timeframe-selector button.active {
    background: var(--electric-blue-muted);
    color: var(--electric-blue);
}

.chart-container {
    flex: 1;
    position: relative;
    width: 100%;
}

/* Right Panel (40%) */
.right-panel {
    flex: 4;
    /* 40% relative */
    display: flex;
    flex-direction: column;
    gap: var(--spacing);
    min-width: 380px;
}

/* Insights Dashboard */
.insights-panel {
    flex: 1;
}

.insights-grid {
    padding: var(--spacing);
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.insight-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: 0.3s ease;
}

.insight-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.insight-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Macro Sentiment */
.sentiment-score {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #1e222d;
    border-radius: 10px;
    overflow: hidden;
}

.progress.fill-bullish {
    background: linear-gradient(90deg, #00b360, var(--neon-green));
    height: 100%;
    border-radius: 10px;
    box-shadow: 0 0 10px var(--neon-green-muted);
}

/* Economic Events */
.event-list {
    list-style: none;
}

.event-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.event-list li:last-child {
    border-bottom: none;
}

.event-time {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: monospace;
}

.event-name {
    flex: 1;
    color: var(--text-main);
    font-size: 0.9rem;
}

/* Trade Setup */
.setup-card {
    background: linear-gradient(180deg, rgba(0, 229, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--electric-blue-muted);
}

.setup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accuracy {
    color: var(--electric-blue);
    font-size: 0.75rem;
    background: var(--electric-blue-muted);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.setup-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 16px;
    color: #e0e3eb;
}

.setup-levels {
    display: flex;
    gap: 8px;
}

.level {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--border-color);
}

.level label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.level span {
    font-family: monospace;
    font-size: 0.95rem;
    margin-top: 4px;
}

.level.entry span {
    color: var(--electric-blue);
}

.level.tp span {
    color: var(--neon-green);
}

.level.sl span {
    color: var(--vivid-red);
}

/* AI Chat */
.chat-panel {
    flex: 1.2;
    background: linear-gradient(180deg, var(--panel-bg) 0%, #0d1017 100%);
}

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

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(0, 255, 136, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0);
    }
}

.chat-history {
    flex: 1;
    padding: var(--spacing);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 90%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--electric-blue-muted);
    color: var(--electric-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    border: 1px solid rgba(0, 229, 255, 0.3);
}

.message-bubble {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #e0e3eb;
}

.message.ai .message-bubble {
    border-top-left-radius: 2px;
}

.message.user .message-bubble {
    background: var(--electric-blue-muted);
    border-color: rgba(0, 229, 255, 0.2);
    color: #fff;
    border-top-right-radius: 2px;
}

.chat-input-container {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.chat-input {
    flex: 1;
    background: #1e222d;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 12px 20px;
    color: var(--text-white);
    font-family: var(--font-family);
    font-size: 0.95rem;
    transition: 0.2s ease;
    outline: none;
}

.chat-input:focus {
    border-color: var(--electric-blue);
    box-shadow: 0 0 0 2px var(--electric-blue-muted);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.send-button {
    background: var(--electric-blue);
    color: #000;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.2s ease;
}

.send-button:hover {
    transform: scale(1.05);
    background: #00f2fe;
    box-shadow: 0 0 15px var(--electric-blue-muted);
}

/* scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Base Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 48px;
    background: rgba(19, 23, 34, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-logo {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: var(--text-white);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.site-logo i {
    color: var(--electric-blue);
    font-size: 1.8rem;
    transform: translateY(3px);
}

.site-logo-tag {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lang-select {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.lang-select:focus {
    border-color: var(--electric-blue);
}

.lang-select option {
    background: var(--bg-dark);
}

.btn-primary {
    background: var(--electric-blue);
    color: #000;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;
}

.btn-primary:hover {
    background: #00f2fe;
    box-shadow: 0 0 15px var(--electric-blue-muted);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Landing Page */
.landing-hero {
    text-align: center;
    padding: 80px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.landing-hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 24px;
    background: linear-gradient(90deg, #fff, var(--electric-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    line-height: 1.6;
}

.landing-hero .cta-group {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.features-section {
    padding: 60px 48px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
}

.feat-icon {
    font-size: 3rem;
    color: var(--neon-green);
    margin-bottom: 24px;
}

.feature-card h3 {
    font-size: 1.5rem;
    color: var(--text-white);
    margin-bottom: 16px;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

.illustration {
    margin: 24px auto;
    width: 100%;
    max-width: 200px;
    height: 150px;
    background: rgba(0, 229, 255, 0.05);
    border-radius: 12px;
    border: 1px dashed var(--electric-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--electric-blue);
    font-size: 4rem;
}

/* Auth Page */
.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.auth-card h2 {
    color: var(--text-white);
    margin-bottom: 8px;
}

.auth-card p {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.auth-input {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 16px;
    color: var(--text-white);
    margin-bottom: 16px;
    font-size: 1rem;
    font-family: inherit;
    transition: 0.2s;
}

.auth-input:focus {
    border-color: var(--electric-blue);
    outline: none;
    box-shadow: 0 0 0 2px var(--electric-blue-muted);
}

.auth-submit {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    margin-top: 8px;
}

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider::before {
    margin-right: 16px;
}

.divider::after {
    margin-left: 16px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    background: #fff;
    color: #000;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
}

.btn-google:hover {
    background: #f1f1f1;
}

/* Widgets */
.floating-widgets {
    position: fixed;
    bottom: 32px;
    right: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.widget-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.widget-btn:hover {
    transform: scale(1.1);
}

.whatsapp-btn {
    background: #25D366;
}

.whatsapp-btn:hover {
    box-shadow: 0 0 20px rgba(37, 211, 102, 0.4);
}

.fb-btn {
    background: #0084FF;
}

.fb-btn:hover {
    box-shadow: 0 0 20px rgba(0, 132, 255, 0.4);
}

.widget-prompt {
    position: fixed;
    bottom: 44px;
    right: 104px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-white);
    font-size: 0.95rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateX(20px);
    transition: 0.4s ease;
    z-index: 999;
}

.widget-prompt.visible {
    opacity: 1;
    transform: translateX(0);
}

.widget-prompt::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: var(--panel-bg);
    border-right: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
}

.close-prompt {
    margin-left: 12px;
    cursor: pointer;
    color: var(--text-muted);
}

.close-prompt:hover {
    color: var(--text-white);
}

/* Widget App-Specific Layout */
body.is-app .floating-widgets {
    right: auto;
    left: 104px;
    bottom: 32px;
}

body.is-app .widget-prompt {
    right: auto;
    left: 174px;
    transform: translateX(-20px);
}

body.is-app .widget-prompt::after {
    right: auto;
    left: -6px;
    border-right: none;
    border-top: none;
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .workspace {
        flex-direction: column;
    }

    .right-panel {
        min-width: 100%;
    }

    .main-view {
        min-height: 50vh;
    }
}

@media (max-width: 768px) {

    body,
    body.is-app {
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .app-container {
        flex-direction: column;
        height: auto !important;
    }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: space-around;
        padding: 12px 0;
    }

    .sidebar .logo {
        display: none;
        /* Logo is already in the header */
    }

    .nav-links {
        flex-direction: row;
        width: 100%;
        justify-content: space-evenly;
        gap: 0;
    }

    .site-header {
        flex-direction: column;
        gap: 16px;
        height: auto !important;
        padding: 16px 20px;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Landing specific mobile */
    .landing-hero {
        padding: 40px 20px;
    }

    .landing-hero h1 {
        font-size: 2.2rem;
    }

    .features-section {
        grid-template-columns: 1fr;
        padding: 40px 20px;
    }

    .cta-group {
        flex-direction: column;
    }

    /* Widget specific mobile */
    .floating-widgets {
        transform: scale(0.85);
        transform-origin: bottom right;
        bottom: 20px;
        right: 20px;
    }

    body.is-app .floating-widgets {
        bottom: 20px;
        left: 20px;
        right: auto;
        transform-origin: bottom left;
    }

    .widget-prompt,
    body.is-app .widget-prompt {
        display: none !important;
    }
}