/* ── bid4ask.com — Trading-themed design ───────────── */

/* Dark theme (default) */
:root {
    --bg-primary: #0a1628;
    --bg-surface: #0e1a2e;
    --bg-surface-hover: #132240;
    --bg-card: rgba(14, 26, 46, 0.8);
    --accent: #00c853;
    --accent-hover: #00e676;
    --accent-glow: rgba(0, 200, 83, 0.3);
    --accent-soft: rgba(0, 200, 83, 0.1);
    --text-primary: #e0e8f0;
    --text-secondary: #7a8ba5;
    --text-muted: #4a5568;
    --border: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(0, 200, 83, 0.3);
    --buy: #00c853;
    --sell: #ef4444;
    --hold: #f59e0b;
    --info: #60a5fa;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --radius: 10px;
    --radius-sm: 6px;
    --sidebar-width: 220px;
    --top-bar-height: 56px;
    --transition: 0.2s ease;
    --gradient-start: #00c853;
    --gradient-end: #00e676;
    --gradient-text-end: #60a5fa;
}

/* Light theme */
body.light-mode {
    --bg-primary: #f0f2f5;
    --bg-surface: #ffffff;
    --bg-surface-hover: #e8ecf1;
    --bg-card: #ffffff;
    --accent: #0066ff;
    --accent-hover: #0052cc;
    --accent-glow: rgba(0, 102, 255, 0.3);
    --accent-soft: rgba(0, 102, 255, 0.08);
    --text-primary: #1a2332;
    --text-secondary: #5a6a7e;
    --text-muted: #9aa5b4;
    --border: rgba(0, 0, 0, 0.1);
    --border-accent: rgba(0, 102, 255, 0.3);
    --buy: #00a844;
    --sell: #dc2626;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --gradient-start: #0066ff;
    --gradient-end: #0052cc;
    --gradient-text-end: #0052cc;
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }
* { scrollbar-width: thin; scrollbar-color: var(--text-muted) transparent; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* Remove native number spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* Global button reset */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: var(--accent);
    color: #fff;
    padding: .5rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 500;
    transition: all var(--transition);
}
button:hover { opacity: .85; }
button:active { transform: scale(0.98); }

/* Global input reset */
input, select, textarea {
    font-family: inherit;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    font-size: .85rem;
    transition: border-color var(--transition);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}
input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

/* Global table styling */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
table th {
    text-align: left;
    padding: .6rem .75rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    white-space: nowrap;
}
table td {
    padding: .6rem .75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table tbody tr:hover { background: var(--bg-surface-hover); }
table .num { text-align: right; }

/* Utility classes */
.mono { font-family: 'JetBrains Mono', monospace; }
.muted { color: var(--text-muted); font-size: .85rem; }
.pnl-positive { color: var(--buy); }
.pnl-negative { color: var(--sell); }
.text-center { text-align: center; }

/* Badge */
.badge {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 600;
    background: var(--bg-surface-hover);
    color: var(--text-secondary);
}
.badge-green { background: rgba(0,200,83,0.15); color: var(--buy); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--sell); }
.badge-blue { background: rgba(96,165,250,0.15); color: var(--info); }
.badge-yellow { background: rgba(245,158,11,0.15); color: var(--hold); }

/* ── Layout ────────────────────────────────────────── */
.page-wrapper {
    display: flex;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-close-btn { display: none; }

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 2rem;
    padding: 0 .5rem;
}

.logo-icon {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: .75rem;
    padding: .3rem .5rem;
    border-radius: var(--radius-sm);
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.top-bar {
    height: var(--top-bar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    margin-right: .75rem;
}

.page-title { font-size: 1rem; font-weight: 600; }

.page-content {
    padding: 2rem;
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Navigation ────────────────────────────────────── */
.nav-menu { list-style: none; }
.nav-menu a {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .75rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-weight: 500;
    font-size: .85rem;
}
.nav-menu a:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.nav-menu a.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-left: 2px solid var(--accent);
}
.nav-menu a .material-icons-outlined { font-size: 1.2rem; }

.nav-section-title {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin: 1.25rem 0 .4rem .75rem;
    font-weight: 600;
}

/* ── Sidebar Footer ────────────────────────────────── */
.sidebar-footer { margin-top: auto; }

.lang-switcher {
    display: flex;
    gap: .5rem;
    padding: .75rem .5rem;
}
.lang-btn {
    padding: .2rem .6rem;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface-hover);
    transition: all var(--transition);
}
.lang-btn.active { background: var(--accent); color: #ffffff; }

.user-info {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem;
    font-size: .8rem;
    color: var(--text-secondary);
}
.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}
.user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-btn, .logout-btn {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .75rem;
    font-size: .8rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.login-btn:hover, .logout-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}
.login-btn .material-icons-outlined,
.logout-btn .material-icons-outlined { font-size: 1rem; }

/* ── Cards ─────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}
.card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .75rem;
    color: var(--text-primary);
}

/* ── Landing ───────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 3rem 0;
}
.hero h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-text-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 2rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius);
    transition: all var(--transition);
    box-shadow: 0 4px 15px var(--accent-glow);
}
.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
    color: #ffffff;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all var(--transition);
}
.feature-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.feature-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1rem;
    display: block;
}
.feature-card h3 {
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: .5rem;
}
.feature-card p {
    font-size: .85rem;
    color: var(--text-secondary);
}

.how-it-works { margin: 3rem 0; }
.how-it-works h2 { text-align: center; margin-bottom: 2rem; }
.steps {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}
.step {
    text-align: center;
    max-width: 200px;
}
.step-num {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 2px solid var(--accent);
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}
.step p { font-size: .85rem; color: var(--text-secondary); }

/* ── Auth ──────────────────────────────────────────── */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    max-width: 400px;
    width: 100%;
}
.auth-logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
}
.auth-card h2 { font-size: 1.3rem; margin-bottom: .5rem; }
.auth-subtitle {
    color: var(--text-secondary);
    font-size: .9rem;
    margin-bottom: 2rem;
}
.google-btn {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 2rem;
    background: #ffffff;
    color: #333;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}
.google-btn:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: #333;
}

/* ── Theme Toggle ──────────────────────────────────── */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem .75rem;
    font-size: .8rem;
    color: var(--text-secondary);
}
.theme-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}
.theme-switch input { opacity: 0; width: 0; height: 0; }
.theme-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--text-muted);
    border-radius: 22px;
    transition: .3s;
}
.theme-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: .3s;
}
.theme-switch input:checked + .theme-slider { background: var(--accent); }
.theme-switch input:checked + .theme-slider::before { transform: translateX(18px); }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform .3s; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close-btn { display: block; text-align: right; }
    .sidebar-close-btn button {
        background: none; border: none; color: var(--text-secondary); cursor: pointer;
    }
    .page-wrapper { max-width: 100%; }
    .menu-toggle { display: block; }
    .features { grid-template-columns: 1fr; }
    .hero h2 { font-size: 1.5rem; }
    .hero-subtitle { font-size: .95rem; }
    .page-content { padding: 1rem; }
    .steps { flex-direction: column; align-items: center; }
    .cta-btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
    .hero { padding: 2rem 0; }
    .hero h2 { font-size: 1.3rem; }
    .cta-btn { font-size: .9rem; padding: .7rem 1.5rem; }
    .feature-card { padding: 1rem; }
    .auth-card { padding: 1.5rem; margin: 0 .5rem; }
}
