:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --neon-cyan: #00f3ff;
    --neon-green: #00ff9d;
    --positive: #10b981;
    --negative: #ef4444;
    --warning: #f59e0b;
    --sidebar-width: 260px;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

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

.logo i {
    font-size: 28px;
}

.logo h1 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.1), rgba(0, 255, 157, 0.1));
    color: var(--text-primary);
    border-left: 3px solid var(--neon-cyan);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

.status-card {
    background: var(--bg-glass);
    border-radius: var(--border-radius);
    padding: 16px;
    border: 1px solid var(--border-color);
    margin-top: auto;
}

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

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.online {
    background: rgba(16, 185, 129, 0.2);
    color: var(--positive);
    border: 1px solid var(--positive);
}

.status-badge.offline {
    background: rgba(239, 68, 68, 0.2);
    color: var(--negative);
    border: 1px solid var(--negative);
}

.status-footer small {
    color: var(--text-muted);
    font-size: 11px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.header-title h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.header-title p {
    color: var(--text-secondary);
    font-size: 14px;
}

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

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* Dashboard Sections */
.dashboard-section,
.coach-section {
    display: none;
}

.dashboard-section.active,
.coach-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Glassmorphism */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    padding: 24px;
    transition: var(--transition);
}

.kpi-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.kpi-header h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
}

.kpi-header i {
    font-size: 24px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.kpi-trend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.kpi-trend.positive {
    color: var(--positive);
}

.kpi-trend.negative {
    color: var(--negative);
}

/* Section Cards */
.section-card {
    padding: 24px;
    margin-bottom: 32px;
}

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

.card-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--neon-cyan);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.trades-table {
    width: 100%;
    border-collapse: collapse;
}

.trades-table th {
    text-align: left;
    padding: 16px 12px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.trades-table td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-color);
}

.trades-table tr:last-child td {
    border-bottom: none;
}

.trades-table tr:hover {
    background: var(--bg-glass-hover);
}

.status-badge.trade {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-win {
    background: rgba(16, 185, 129, 0.2);
    color: var(--positive);
}

.status-loss {
    background: rgba(239, 68, 68, 0.2);
    color: var(--negative);
}

.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.loading-row {
    text-align: center;
    padding: 40px !important;
}

.loading-row td {
    border: none !important;
}

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

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

/* Chat UI */
.coach-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.chat-container {
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    max-height: 450px;
    margin-bottom: 20px;
}

.message {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    animation: messageAppear 0.3s ease;
}

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.ai-message .message-avatar {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
}

.message-content {
    flex: 1;
    background: var(--bg-glass);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.message-sender {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.message-text {
    line-height: 1.5;
    margin-bottom: 8px;
}

.message-time {
    font-size: 12px;
    color: var(--text-muted);
}

.chat-input-container {
    margin-top: auto;
}

.typing-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    color: var(--neon-cyan);
    font-size: 14px;
    margin-bottom: 12px;
    padding: 0 16px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--neon-cyan);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.input-group {
    display: flex;
    gap: 12px;
}

.input-group textarea {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    resize: none;
    transition: var(--transition);
}

.input-group textarea:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 2px rgba(0, 243, 255, 0.1);
}

.btn-primary {
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
    color: var(--bg-primary);
    border: none;
    border-radius: var(--border-radius);
    padding: 0 24px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 243, 255, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.input-hint {
    margin-top: 8px;
    padding: 0 16px;
}

.input-hint kbd {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid var(--border-color);
}

/* Quick Questions */
.quick-questions {
    padding: 20px;
}

.quick-questions h4 {
    margin-bottom: 16px;
    font-size: 16px;
    color: var(--text-secondary);
}

.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.quick-question {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.quick-question:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--neon-cyan);
    transform: translateY(-2px);
}

/* Neon Accents */
.neon-cyan {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.neon-green {
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(0, 255, 157, 0.5);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 20px 12px;
    }
    
    .logo h1, 
    .nav-item span,
    .status-footer,
    .status-header span:first-child {
        display: none;
    }
    
    .logo {
        justify-content: center;
        margin-bottom: 30px;
    }
    
    .nav-item {
        justify-content: center;
        padding: 16px;
    }
    
    .main-content {
        margin-left: 80px;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .questions-grid {
        grid-template-columns: 1fr;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .btn-primary {
        padding: 12px;
        justify-content: center;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}
