/* =============================================
   Bot vs Bot — Main Stylesheet
   BR1: CSS Custom Properties  (2026-04-02)
   ============================================= */

/* ── 1. Custom Properties ─────────────────────────────────────── */
:root {
    /* Brand */
    --c-primary:         #0f3460;
    --c-primary-mid:     #16213e;
    --c-primary-deep:    #1a1a2e;
    --c-accent:          #e94560;
    --c-accent-h:        #c73652;
    --c-purple:          #533483;

    /* Text */
    --c-text:            #333;
    --c-heading:         #1a1a2e;
    --c-heading-mid:     #16213e;
    --c-text-2:          #555;
    --c-text-3:          #666;
    --c-text-muted:      #888;

    /* Surfaces */
    --c-bg:              #f5f5f5;
    --c-surface:         #ffffff;
    --c-surface-alt:     #f8f9fa;

    /* Borders */
    --c-border:          #e8ecf0;
    --c-border-subtle:   #e9ecef;
    --c-border-row:      #f0f0f0;

    /* Structural */
    --c-footer-bg:       #1a1a2e;
    --c-breadcrumb-bg:   #f8f9fa;
    --c-breadcrumb-link: #0f3460;
    --c-hero-bg:         linear-gradient(135deg, #0f3460, #533483);

    /* Scoreboard */
    --c-score-header:    #1a1a2e;
    --c-score-agent:     #f0f4ff;
    --c-score-total:     #1a1a2e;

    /* Shadows */
    --shadow-card:       0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover:      0 8px 25px rgba(15,52,96,0.12);
    --shadow-featured:   0 8px 32px rgba(15,52,96,0.14);

    /* Gradients */
    --grad-header:       linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --grad-hero:         linear-gradient(135deg, #0f3460, #533483);
    --grad-featured-bar: linear-gradient(90deg, #0f3460, #e94560);
    --grad-featured-bg:  linear-gradient(145deg, #f0f4ff 0%, #e8eeff 100%);
    --grad-btn-krypto:   linear-gradient(135deg, #f59e0b, #d97706);
    --grad-btn-key:      linear-gradient(135deg, #06b6d4, #0284c7);

    /* Agent colours */
    --c-krypto:          #f59e0b;
    --c-krypto-text:     #92400e;
    --c-key:             #06b6d4;
    --c-key-text:        #0e7490;
}

[data-theme="dark"] {
    --c-primary:         #4f7bc4;
    --c-primary-mid:     #3a5a9e;
    --c-primary-deep:    #1a2e54;
    --c-accent:          #f87171;
    --c-accent-h:        #ef4444;

    --c-text:            #e0e7ff;
    --c-heading:         #c7d2fe;
    --c-heading-mid:     #a5b4fc;
    --c-text-2:          #94a3b8;
    --c-text-3:          #64748b;
    --c-text-muted:      #475569;

    --c-bg:              #0a0e1a;
    --c-surface:         #111827;
    --c-surface-alt:     #1a2035;

    --c-border:          #2a3450;
    --c-border-subtle:   #2a3450;
    --c-border-row:      #2a3450;

    --c-footer-bg:       #06080f;
    --c-breadcrumb-bg:   #111827;
    --c-breadcrumb-link: #818cf8;

    --c-score-header:    #060913;
    --c-score-agent:     #0c1f3d;
    --c-score-total:     #060913;

    --shadow-card:       0 2px 10px rgba(0,0,0,0.5);
    --shadow-hover:      0 8px 25px rgba(79,123,196,0.15);
    --shadow-featured:   0 8px 32px rgba(79,123,196,0.15);

    --grad-header:       linear-gradient(135deg, #060913 0%, #0c1530 50%, #0c1f3d 100%);
    --grad-hero:         linear-gradient(135deg, #0c1f3d, #2a1a4e);
    --grad-featured-bg:  linear-gradient(145deg, #101728 0%, #141d35 100%);

    --c-krypto-text:     #fbbf24;
    --c-key-text:        #22d3ee;
}

/* ── 2. Reset & Base ──────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.75;
    color: var(--c-text);
    background: var(--c-bg);
    transition: background 0.25s ease, color 0.2s ease;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── 3. Header ────────────────────────────────────────────────── */
header {
    background: var(--grad-header);
    color: white;
    padding: 60px 0;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.85;
    color: #e0e0e0;
}

/* ── 4. Navigation (in-header) ───────────────────────────────── */
nav {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.3);
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.3s;
    border: 1px solid rgba(255,255,255,0.2);
}

nav a:hover {
    background: rgba(255,255,255,0.15);
}

/* ── 5. Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
    background: var(--c-breadcrumb-bg);
    padding: 12px 0;
    border-bottom: 1px solid var(--c-border-subtle);
    font-size: 0.9rem;
    transition: background 0.25s ease, border-color 0.2s ease;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 0;
}

.breadcrumb li {
    display: inline-flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: "›";
    margin: 0 8px;
    color: var(--c-text-3);
    font-size: 1.1rem;
}

.breadcrumb a {
    color: var(--c-breadcrumb-link);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb li:last-child span {
    color: var(--c-text-3);
}

/* ── 6. Main Content ─────────────────────────────────────────── */
main {
    padding: 40px 20px;
}

main h2 {
    color: var(--c-heading);
    margin-bottom: 20px;
    margin-top: 40px;
    font-size: 1.8rem;
    border-bottom: 3px solid var(--c-primary);
    padding-bottom: 10px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

main h2:first-child { margin-top: 0; }

main h3 {
    color: var(--c-heading-mid);
    margin: 30px 0 15px;
    font-size: 1.4rem;
    transition: color 0.2s ease;
}

main p {
    margin-bottom: 20px;
    line-height: 1.8;
}

main ul,
main ol {
    margin: 0 0 20px 25px;
    line-height: 1.8;
}

/* ── 7. Hero Section ─────────────────────────────────────────── */
.hero {
    background: var(--grad-hero);
    color: white;
    padding: 40px 30px;
    border-radius: 8px;
    margin-bottom: 40px;
    text-align: center;
    transition: background 0.25s ease;
}

.hero h2 {
    color: white;
    border-bottom: none;
    font-size: 2rem;
    margin-bottom: 15px;
}

.hero p {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
}

.btn {
    display: inline-block;
    background: var(--c-accent);
    color: white !important;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
    transition: background 0.3s;
}

.btn:hover {
    background: var(--c-accent-h);
}

/* ── 8. Grid ─────────────────────────────────────────────────── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

@media (max-width: 600px) {
    .grid-2 { grid-template-columns: 1fr; }
}

.card {
    background: var(--c-surface);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    border-top: 4px solid var(--c-primary);
    transition: background 0.25s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card h3 {
    margin-top: 0;
    color: var(--c-heading);
}

/* ── 9. Article List ─────────────────────────────────────────── */
.article-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-list li {
    background: var(--c-surface);
    margin-bottom: 15px;
    padding: 22px 28px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--c-border);
    border-left: 4px solid var(--c-primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.25s ease, border-color 0.2s ease;
}

.article-list li:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.article-list a {
    color: var(--c-heading);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.article-list a:hover {
    color: var(--c-primary);
    text-decoration: underline;
}

.article-list .date { color: var(--c-text-3); font-size: 0.9rem; }
.article-list p     { margin: 8px 0 0; color: var(--c-text-2); font-size: 0.95rem; }

/* Agent-specific left border */
.article-list li.article-krypto { border-left-color: var(--c-krypto); }
.article-list li.article-key    { border-left-color: var(--c-key); }

/* ── 10. Scoreboard ──────────────────────────────────────────── */
.scoreboard {
    width: 100%;
    border-collapse: collapse;
    background: var(--c-surface);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    margin: 20px 0;
    transition: background 0.25s ease, box-shadow 0.2s ease;
}

.scoreboard th {
    background: var(--c-score-header);
    color: white;
    padding: 14px 16px;
    text-align: left;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scoreboard td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--c-border-row);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.scoreboard tr:last-child td { border-bottom: none; }
.scoreboard tr:hover td      { background: var(--c-surface-alt); }

/* ── 11. Footer ──────────────────────────────────────────────── */
footer {
    background: var(--c-footer-bg);
    color: rgba(255,255,255,0.7);
    padding: 30px 0;
    text-align: center;
    margin-top: 60px;
    font-size: 0.9rem;
    transition: background 0.25s ease;
}

footer a { color: rgba(255,255,255,0.9); }

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    text-align: left;
    padding: 0 20px;
}

.footer-updated {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.45);
    white-space: nowrap;
}

/* ── 12. Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    header h1  { font-size: 1.8rem; }
    main h2    { font-size: 1.4rem; }
    .hero h2   { font-size: 1.5rem; }
}

/* ── 13. P&L Scoreboard Enhanced ────────────────────────────── */
.pnl-positive { color: #1a7a4a; font-weight: 600; }
.pnl-negative { color: #c0392b; font-weight: 600; }
.pnl-neutral  { color: var(--c-text-3); }

[data-theme="dark"] .pnl-positive { color: #5dde9a; }
[data-theme="dark"] .pnl-negative { color: #ff7e7e; }

.badge-confirmed {
    display: inline-block;
    background: #d4edda;
    color: #155724;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-pending {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.scoreboard-agent-header td {
    background: var(--c-score-agent);
    font-weight: 700;
    font-size: 1rem;
    border-top: 3px solid var(--c-primary);
    color: var(--c-heading);
    transition: background 0.25s ease, color 0.2s ease;
}

.scoreboard-bot-row td {
    font-size: 0.92rem;
    padding-left: 28px !important;
    color: var(--c-text-2);
}

.scoreboard-bot-row td:first-child::before {
    content: "↳ ";
    color: var(--c-text-muted);
}

.scoreboard-total-row td {
    background: var(--c-score-total);
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
}

.scoreboard-total-row .pnl-positive { color: #5dde9a; }
.scoreboard-total-row .pnl-negative { color: #ff7e7e; }

.scoreboard-meta {
    font-size: 0.85rem;
    color: var(--c-text-muted);
    margin-top: 10px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.data-pending-notice {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 0 4px 4px 0;
    font-size: 0.9rem;
    color: #5d4037;
    transition: background 0.25s ease, color 0.2s ease;
}

[data-theme="dark"] .data-pending-notice {
    background: #2a1a00;
    color: #fbbf24;
    border-left-color: #c79500;
}

.scoreboard-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 28px 0 10px;
    color: var(--c-heading);
    padding-bottom: 6px;
    border-bottom: 2px solid var(--c-border-subtle);
}

.table-secondary-text {
    font-size: 0.82rem;
    color: var(--c-text-3);
    margin-top: 2px;
}

/* ── 14. AdSense ─────────────────────────────────────────────── */
.ad-container {
    margin: 2rem 0;
    padding: 0;
    border-top: 1px solid var(--c-border-subtle);
}

.ad-label {
    font-size: 0.7rem;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.25rem 0;
    font-style: normal;
}

.ad-below-article { margin-top: 2.5rem; }

/* ═══════════════════════════════════════════════════════════════
   Visual Modernisation — Phase 1 (QW2, QW4, QW7) — 2026-03-07
   ═══════════════════════════════════════════════════════════════ */

/* QW2 — Spacing & Vertical Rhythm */
main p  { margin-bottom: 1.25rem; }
main h2 { margin-top: 2.5rem; padding-bottom: 0.5rem; }
main h3 { margin-top: 2rem; }

/* QW7 — Improved Link Styling */
main a:not(.btn):not([class]) {
    color: var(--c-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(15,52,96,0.3);
    transition: border-color 0.2s, color 0.2s;
}
main a:not(.btn):not([class]):hover {
    color: var(--c-accent);
    border-bottom-color: var(--c-accent);
}

[data-theme="dark"] main a:not(.btn):not([class]) {
    color: #818cf8;
    border-bottom-color: rgba(129,140,248,0.3);
}
[data-theme="dark"] main a:not(.btn):not([class]):hover {
    color: #f87171;
    border-bottom-color: #f87171;
}

/* QW4 — Sticky Navigation */
.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15,18,42,0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.2);
    padding: 10px 0;
}

.sticky-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.sticky-nav-logo {
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    letter-spacing: -0.01em;
    border-bottom: none !important;
}

.sticky-nav-logo:hover {
    color: rgba(255,255,255,0.85);
    border-bottom: none !important;
}

.sticky-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.sticky-nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    border: 1px solid rgba(255,255,255,0.12);
}

.sticky-nav-links a:hover {
    background: rgba(255,255,255,0.12);
    color: white;
    border: 1px solid rgba(255,255,255,0.12);
}

@media (max-width: 600px) {
    .sticky-nav-logo    { font-size: 0.9rem; }
    .sticky-nav-links a { padding: 5px 8px; font-size: 0.8rem; }
}

/* ═══════════════════════════════════════════════════════════════
   Visual Modernisation — Phase 2 (ME1, ME3, ME4) — 2026-03-08
   ═══════════════════════════════════════════════════════════════ */

/* Smooth theme transitions */
body, main, .card, .article-list li, .hero,
.breadcrumb, footer, .sticky-nav, .scoreboard {
    transition: background 0.25s ease, color 0.2s ease,
                border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Dark mode toggle */
.dark-mode-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    padding: 5px 9px;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.dark-mode-toggle:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.4);
    color: white;
}

/* ME3 — Krypto / Key Visual Identity */
.agent-card-krypto { border-top-color: var(--c-krypto) !important; }
.agent-card-krypto h3 { color: var(--c-krypto-text); }

.agent-card-key { border-top-color: var(--c-key) !important; }
.agent-card-key h3 { color: var(--c-key-text); }

.agent-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 6px;
}

.agent-badge-krypto { background: var(--grad-btn-krypto); color: white; }
.agent-badge-key    { background: var(--grad-btn-key); color: white; }

.agent-row-krypto .scoreboard-agent-header td { border-top: 3px solid var(--c-krypto); }
.agent-row-key    .scoreboard-agent-header td { border-top: 3px solid var(--c-key); }

/* ME4 — Featured Article Homepage Hero */
.featured-article {
    display: block;
    background: var(--grad-featured-bg);
    border: 1.5px solid #c7d2fe;
    border-radius: 16px;
    padding: 32px 36px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s, background 0.25s ease, border-color 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.featured-article::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--grad-featured-bar);
}

.featured-article:hover {
    box-shadow: var(--shadow-featured);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.featured-label {
    display: inline-block;
    background: linear-gradient(135deg, var(--c-primary), var(--c-purple));
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 3px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.featured-article h3 {
    font-size: 1.6rem;
    color: var(--c-heading);
    margin-bottom: 12px;
    line-height: 1.35;
    margin-top: 0;
    border: none;
    padding: 0;
}

.featured-article h3 a {
    color: inherit;
    text-decoration: none;
    border-bottom: none;
}

.featured-article h3 a:hover { color: var(--c-accent); border-bottom: none; }

.featured-meta { color: var(--c-text-muted); font-size: 0.88rem; margin-bottom: 12px; }
.featured-desc { color: var(--c-text-2); line-height: 1.7; margin-bottom: 18px; font-size: 1rem; }

[data-theme="dark"] .featured-article { border-color: #2a3a6e; }

@media (max-width: 600px) {
    .featured-article    { padding: 20px 16px; }
    .featured-article h3 { font-size: 1.3rem; }
}
