/* AITradeBot - Main Stylesheet */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Navbar */
#mainNav {
    background: transparent;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    padding: 12px 0;
    transition: all 0.4s ease;
}

#mainNav.scrolled {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}

#mainNav .navbar-brand { color: #0f172a; }
#mainNav.scrolled .navbar-brand { color: #0f172a; }

#mainNav .nav-link {
    color: #475569;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
}

#mainNav .nav-link:hover {
    color: #0f172a;
}

#mainNav.scrolled .nav-link { color: #475569; }
#mainNav.scrolled .nav-link:hover { color: #0f172a; }

#mainNav .btn-outline-light {
    color: #475569;
    border-color: #cbd5e1;
}
#mainNav .btn-outline-light:hover {
    color: #0f172a;
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* Buttons */
.btn-primary {
    background: #3b82f6;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Brand byline */
.brand-byline {
    font-size: 0.55em;
    font-weight: 400;
    opacity: 0.5;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 2px;
}

#mainNav .navbar-brand:hover .brand-byline {
    opacity: 0.8;
}

/* Footer */
.site-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 60px 0 0;
    margin-top: 0;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand {
    max-width: 360px;
}

.footer-logo {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-logo i {
    color: #3b82f6;
    font-size: 1.4rem;
}

.footer-logo .brand-byline {
    color: #64748b;
}

.footer-logo:hover {
    color: #fff;
}

.footer-tagline {
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-top: 12px;
    margin-bottom: 0;
}

.footer-links {
    display: flex;
    gap: 64px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-col h6 {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.footer-col a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: #fff;
}

.footer-bottom {
    padding: 24px 0;
    margin-top: 0;
    text-align: center;
    font-size: 0.82rem;
    color: #475569;
}

/* Mobile navbar */
@media (max-width: 991px) {
    #mainNav .navbar-collapse {
        background: #fff;
        border-radius: 12px;
        padding: 20px;
        margin-top: 12px;
        box-shadow: 0 12px 40px rgba(0,0,0,0.1);
        border: 1px solid #e2e8f0;
    }
    #mainNav .navbar-nav {
        gap: 4px;
    }
    #mainNav .navbar-nav .nav-link {
        padding: 10px 16px;
        border-radius: 8px;
        color: #334155;
    }
    #mainNav .navbar-nav .nav-link:hover {
        background: #f1f5f9;
        color: #0f172a;
    }
    #mainNav .d-flex.gap-2 {
        flex-direction: column;
        gap: 8px !important;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #e2e8f0;
    }
    #mainNav .d-flex.gap-2 .btn {
        width: 100%;
        justify-content: center;
    }
    #mainNav .navbar-toggler {
        border-color: #cbd5e1;
        padding: 4px 10px;
    }
    #mainNav .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23475569' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }
}

@media (max-width: 768px) {
    .footer-top {
        flex-direction: column;
        gap: 32px;
    }
    .footer-brand {
        max-width: 100%;
    }
    .footer-links {
        gap: 40px;
    }
    .footer-bottom {
        font-size: 0.75rem;
    }
}

/* Selection */
::selection {
    background: rgba(59, 130, 246, 0.3);
}

/* ===================== Dashboard ===================== */

.dash-wrapper {
    min-height: 100vh;
    background: #f8fafc;
}

/* Sidebar */
.dash-sidebar {
    width: 260px;
    min-height: 100vh;
    background: #0f172a;
    padding: 24px 16px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    overflow-y: auto;
}

.dash-sidebar-brand {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 16px;
}

.dash-sidebar-brand i { color: #3b82f6; }
.dash-sidebar-brand:hover { color: #fff; }

.dash-nav {
    gap: 2px;
}

.dash-nav .nav-link {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s ease;
}

.dash-nav .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.dash-nav .nav-link:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,0.06);
}

.dash-nav .nav-link.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.15);
    border-left: 3px solid #3b82f6;
    margin-left: -3px;
}

.dash-badge {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
    color: #94a3b8;
    padding: 2px 8px;
    border-radius: 10px;
}

.dash-badge-tier {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.dash-sidebar-footer {
    padding: 16px 8px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.dash-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 0.82rem;
}

.dash-user-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-sidebar-footer .btn-outline-light {
    font-size: 0.78rem;
    border-color: rgba(255,255,255,0.15);
    color: #94a3b8;
}

.dash-sidebar-footer .btn-outline-light:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

/* Main content */
.dash-main {
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
}

/* Top bar */
.dash-topbar {
    display: flex;
    align-items: center;
    margin: -8px 0 20px;
}

.dash-messages {
    margin-bottom: 16px;
}

/* Mobile top bar */
.dash-mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 90;
}

.dash-mobile-header .dash-sidebar-brand {
    padding: 0;
    border: none;
    margin: 0;
    font-size: 1rem;
    color: #0f172a;
}

.dash-offcanvas {
    background: #0f172a;
    max-width: 280px;
}

.dash-offcanvas .offcanvas-header {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 20px 16px;
}

.dash-offcanvas .btn-close {
    filter: invert(1);
}

.dash-offcanvas .dash-nav {
    padding: 16px;
}

.dash-offcanvas .dash-sidebar-footer {
    padding: 16px;
}

/* Dashboard cards */
.dash-card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    background: #fff;
    transition: box-shadow 0.2s ease;
}

.dash-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.dash-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.dash-stat-label {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 4px;
}

.dash-progress {
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    margin-top: 12px;
}

.dash-progress-bar {
    height: 100%;
    border-radius: 2px;
    background: #3b82f6;
    transition: width 0.3s ease;
}

/* Status badges */
.badge-running { background: rgba(6,214,160,0.15); color: #06d6a0; }
.badge-idle { background: rgba(100,116,139,0.15); color: #64748b; }
.badge-paused { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-stopped { background: rgba(100,116,139,0.15); color: #64748b; }
.badge-error { background: rgba(239,68,68,0.15); color: #ef4444; }

/* Algorithm select cards */
.algo-card {
    cursor: pointer;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.15s ease;
    position: relative;
}

.algo-card:hover {
    border-color: #93c5fd;
    background: #f0f7ff;
}

.algo-card.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.algo-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.algo-card .algo-icon {
    font-size: 1.8rem;
    color: #3b82f6;
    margin-bottom: 8px;
}

.algo-card .algo-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #0f172a;
}

.algo-card .algo-desc {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.4;
}

.algo-card .lock-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* Exchange cards */
.exchange-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.15s ease;
}

.exchange-card:hover {
    border-color: #93c5fd;
}

.exchange-card .exchange-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

/* Empty state */
.dash-empty {
    text-align: center;
    padding: 48px 24px;
}

.dash-empty i {
    font-size: 3rem;
    color: #cbd5e1;
}

.dash-empty p {
    color: #64748b;
    margin-top: 12px;
}

/* Mobile responsive */
@media (max-width: 991px) {
    .dash-main {
        margin-left: 0;
        padding: 72px 16px 24px;
    }
}

@media (max-width: 576px) {
    .dash-main {
        padding: 64px 12px 20px;
    }
}
