:root {
    --bg-dark: #0a0d14;
    --bg-card: #121824;
    --bg-card-hover: #172131;
    --border-color: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.25);
    --gold: #f59e0b;
    --danger: #ef4444;
    --cyan: #06b6d4;
    --pitch-green: #15803d;
    --pitch-dark: #166534;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
    overflow-x: hidden;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar (Desktop) */
.sidebar {
    width: 260px;
    background-color: #0d121c;
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-left: 8px;
}

.brand-app-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.brand-text h1 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.badge-sub {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.nav-item:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.02));
    border-left: 3px solid var(--accent);
}

.nav-icon {
    font-size: 18px;
}

.bot-sidebar-widget {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
}

.bot-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.bot-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--danger);
    transition: background-color 0.3s;
}

.bot-indicator.active {
    background-color: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.bot-title {
    font-size: 13px;
    font-weight: 600;
}

.bot-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px 32px;
    max-width: 1400px;
}

/* Mobile Header */
.mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 18px 0;
}

.mobile-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.mobile-header h2 {
    font-size: 18px;
    font-weight: 800;
}

.mobile-subtitle {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
}

.status-pill-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background-color: rgba(16, 185, 129, 0.15);
    border-radius: 20px;
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
}

/* Bot Hero Control Card */
.bot-control-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.08));
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 16px;
    padding: 18px 22px;
    margin-bottom: 20px;
}

.bot-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.bot-status-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 280px;
}

.bot-pulse-icon {
    font-size: 24px;
    background: rgba(16, 185, 129, 0.2);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: var(--accent);
}

.bot-hero-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.bot-hero-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.4;
}

.bot-quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Login Prompt Card */
.login-prompt-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.login-prompt-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.hero-login-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
}

/* Stats Ribbon */
.stats-ribbon-container {
    margin-bottom: 24px;
}

.stats-ribbon {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 20px;
}

.stat-box {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 17px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 2px;
}

.text-accent { color: var(--accent); }
.text-gold { color: var(--gold); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }

/* Buttons & Controls */
.btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--cyan);
    color: #051622;
}

.btn-primary:hover {
    background-color: #22d3ee;
}

.btn-accent {
    background-color: var(--accent);
    color: #032b1a;
}

.btn-accent:hover {
    background-color: #34d399;
}

.btn-secondary {
    background-color: #1e293b;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #334155;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.btn-danger-outline:hover {
    background-color: rgba(239, 68, 68, 0.15);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Tab panes */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

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

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.card-icon {
    font-size: 32px;
}

.card-huge-number {
    font-size: 22px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 4px;
}

.squad-summary-cards {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

/* Market Cards Grid */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.player-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.player-card.strong-buy {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.player-title {
    font-size: 17px;
    font-weight: 700;
}

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

.signal-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.signal-strong_buy { background: rgba(16, 185, 129, 0.2); color: var(--accent); }
.signal-buy { background: rgba(6, 182, 212, 0.2); color: var(--cyan); }
.signal-neutral { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }
.signal-avoid { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

.card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
    background-color: rgba(0, 0, 0, 0.25);
    padding: 10px;
    border-radius: 10px;
}

.mini-stat label {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

.mini-stat span {
    font-size: 13px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.card-reason {
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 14px;
    line-height: 1.4;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

/* Tables */
.table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    background-color: #0d131f;
    padding: 12px 14px;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

/* Pitch */
.pitch-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.soccer-pitch {
    background: linear-gradient(to bottom, #14532d, #166534);
    border: 2px solid #fff;
    border-radius: 16px;
    height: 540px;
    position: relative;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.pitch-line {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.center-line { top: 50%; left: 0; right: 0; border-width: 1px 0 0 0; }
.center-circle { top: 50%; left: 50%; width: 100px; height: 100px; transform: translate(-50%, -50%); border-radius: 50%; }
.penalty-box.top-box { top: 0; left: 50%; width: 180px; height: 70px; transform: translateX(-50%); border-top: none; }
.penalty-box.bottom-box { bottom: 0; left: 50%; width: 180px; height: 70px; transform: translateX(-50%); border-bottom: none; }

.pitch-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 2;
}

.pitch-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
}

.pitch-avatar {
    width: 44px;
    height: 44px;
    background-color: #0f172a;
    border: 2px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.pitch-name {
    font-size: 11px;
    font-weight: 600;
    background: rgba(0,0,0,0.7);
    padding: 2px 6px;
    border-radius: 6px;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pitch-points {
    font-size: 10px;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}

.points-display {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    margin: 8px 0 4px 0;
}

.formation-badge {
    background-color: rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
}

.bench-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    max-height: 320px;
    overflow-y: auto;
}

.bench-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 12px;
}

/* Kicktipp Grid */
.kicktipp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.kicktipp-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px;
}

.match-header {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.team-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.team-name {
    font-size: 13px;
    font-weight: 600;
}

.match-vs {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0 8px;
}

.tip-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.tip-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent);
}

.tip-score {
    font-size: 26px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    margin: 2px 0;
}

.tip-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* QR Code Container */
.qr-container {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 16px;
    border-radius: 14px;
    flex-wrap: wrap;
}

.qr-img {
    width: 140px;
    height: 140px;
    border-radius: 10px;
    border: 2px solid var(--accent);
}

.qr-info {
    flex: 1;
    min-width: 200px;
}

.qr-url {
    font-size: 18px;
    font-weight: 700;
    color: var(--cyan);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 6px;
}

/* Console logs */
.trade-log-console {
    background-color: #070a10;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    height: 260px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.log-entry { line-height: 1.4; }
.log-info { color: #38bdf8; }
.log-success { color: var(--accent); }
.log-warn { color: var(--gold); }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.form-input {
    width: 100%;
    padding: 12px 14px;
    background-color: #0b0f17;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-row { display: flex; gap: 10px; }
.feedback-msg { margin-top: 10px; font-size: 13px; font-weight: 500; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    width: 440px;
    max-width: 100%;
}

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.alert-banner {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
}

.alert-danger { background-color: rgba(239, 68, 68, 0.15); border: 1px solid var(--danger); color: #fca5a5; }
.alert-safe { background-color: rgba(16, 185, 129, 0.15); border: 1px solid var(--accent); color: #86efac; }

.mt-4 { margin-top: 20px; }
.mb-3 { margin-bottom: 10px; }
.mb-4 { margin-bottom: 20px; }
.text-center { text-align: center; }

/* Responsive & Mobile-first Navigation */
.mobile-only { display: none; }
.desktop-only { display: flex; }

@media (max-width: 860px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; }

    .main-content {
        padding: 12px 16px 85px 16px; /* Padding for bottom nav */
    }

    .hero-login-form {
        grid-template-columns: 1fr;
    }

    .stats-ribbon {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px 14px;
    }

    .stat-value {
        font-size: 15px;
    }

    .pitch-layout {
        grid-template-columns: 1fr;
    }

    .soccer-pitch {
        height: 480px;
    }

    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background-color: #0b101a;
        border-top: 1px solid var(--border-color);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 999;
        padding-bottom: env(safe-area-inset-bottom);
        backdrop-filter: blur(10px);
    }

    .bottom-nav-item {
        background: transparent;
        border: none;
        color: var(--text-muted);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        font-size: 11px;
        font-family: inherit;
        font-weight: 500;
        cursor: pointer;
        padding: 6px 12px;
        transition: color 0.2s;
    }

    .bottom-nav-icon {
        font-size: 20px;
    }

    .bottom-nav-item.active {
        color: var(--accent);
    }

    .bottom-nav-item.active .bottom-nav-icon {
        transform: translateY(-2px);
    }
}
