﻿/* ============ CSS VARIABLES - LIGHT THEME ============ */
:root {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fa;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #8888aa;
    --gold: #f0b90b;
    --gold-dark: #d4a00a;
    --gold-light: #fce8a0;
    --green: #00b894;
    --green-light: #e0f7f0;
    --red: #e17055;
    --red-light: #fde8e4;
    --blue: #0984e3;
    --border-color: #e0e4ea;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 24px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

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

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

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

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

/* ============ HEADER ============ */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    flex-wrap: wrap;
}

.logo { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.logo span { color: var(--gold); }
.logo a { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 28px; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    padding: 6px 0;
    position: relative;
    color: var(--text-secondary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a:hover,
.nav-links a.active { color: var(--gold); }

.nav-right { display: flex; align-items: center; gap: 15px; }

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--green);
    background: var(--green-light);
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(0,184,148,0.2);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============ HERO ============ */
.hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 60px 0 50px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #1a1a2e;
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 24px;
}

.btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--gold);
    color: #1a1a2e;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(240,185,11,0.3);
    color: #1a1a2e;
}

/* ============ FEATURES ============ */
.features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 40px 0;
}

.feature-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: block;
    color: inherit;
    text-decoration: none;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: var(--shadow-hover);
}

.feature-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.feature-title { font-size: 14px; font-weight: 600; }
.feature-desc { font-size: 12px; color: var(--text-muted); }

/* ============ GRID ============ */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 20px 0 40px;
}

/* Modifier for a .grid that only has 2 items (e.g. homepage Signals+Brokers row) — placed
   before the existing @media rules below so they still correctly collapse this to 1 column
   on mobile, same as the base 3-column .grid does. */
.grid-2col { grid-template-columns: repeat(2, 1fr); }

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.card h3 {
    color: var(--gold-dark);
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: 700;
}

/* Wrap any data table (.market-table, .calendar-table, .dash-table) in this so it scrolls
   horizontally on narrow screens instead of overflowing the page or squishing unreadably. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ============ SIGNAL CARDS ============ */
.signal-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    border-left: 4px solid var(--green);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.signal-card.sell { border-left-color: var(--red); }
.signal-card:hover { background: var(--bg-card-hover); }

.signal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.signal-symbol { font-weight: 700; font-size: 15px; color: var(--text-primary); }

.signal-type {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.signal-type.buy { background: var(--green-light); color: var(--green); }
.signal-type.sell { background: var(--red-light); color: var(--red); }

.signal-details {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.signal-details span { margin-right: 12px; }

.confidence-bar {
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--green);
    transition: width 0.6s ease;
}

/* A signal's entry/SL/TP is only realistically actionable within ~15 minutes of generation —
   used on signals.html and dashboard.html to blur out stale ones rather than remove them
   outright, so recent history stays visible but visually marked as no longer actionable. */
.signal-wrapper { position: relative; }
.signal-wrapper.expired .signal-card { filter: blur(3px); opacity: 0.55; pointer-events: none; user-select: none; }
.expired-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20,20,30,0.85);
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 2;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* ============ BLOG POSTS ============ */
.post-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.post-item:last-child { border-bottom: none; }

.post-item h4 {
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 3px;
}

.post-item h4 a { color: inherit; }
.post-item h4 a:hover { color: var(--gold); }

.post-item p {
    color: var(--text-secondary);
    font-size: 12px;
}

.post-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 3px;
    flex-wrap: wrap;
}

.ai-badge {
    font-size: 9px;
    background: var(--green-light);
    color: var(--green);
    padding: 1px 8px;
    border-radius: 12px;
    display: inline-block;
    font-weight: 600;
}

/* ============ BROKERS ============ */
.broker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 6px;
}

.broker-item:last-child { border-bottom: none; }
.broker-name { font-weight: 600; color: var(--text-primary); }
.broker-rating { color: var(--gold); }

.broker-details {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.broker-open-btn {
    display: inline-block;
    padding: 6px 14px;
    background: var(--gold);
    color: #1a1a2e;
    font-weight: 600;
    font-size: 12px;
    border-radius: 6px;
    transition: var(--transition);
    white-space: nowrap;
}

.broker-open-btn:hover {
    color: #1a1a2e;
    box-shadow: 0 4px 16px rgba(240,185,11,0.3);
}

/* ============ FOOTER ============ */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    margin-top: 40px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-links-row {
    display: flex;
    justify-content: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 10px;
    column-gap: 20px;
    list-style: none;
}

.footer-links a {
    font-size: 12px;
    color: var(--text-muted);
}

.footer-links a:hover { color: var(--gold); }

.footer-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-social {
    display: flex;
    gap: 14px;
    list-style: none;
}

.footer-social a {
    line-height: 1;
    opacity: 0.75;
    transition: opacity 0.15s, transform 0.15s;
}

.footer-social a img {
    width: 20px;
    height: 20px;
    display: block;
}

.footer-social a:hover {
    opacity: 1;
    transform: translateY(-2px);
}
.footer-copy { font-size: 12px; color: var(--text-muted); }

/* Newsletter signup — injected into every page's footer by js/footer-pages.js
   (moved out of individual blog posts so it's site-wide, not just when reading one). */
.newsletter-box { background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-primary) 100%); border-radius: var(--radius); padding: 30px; margin-bottom: 24px; border: 1px solid var(--border-color); text-align: center; }
.newsletter-box h3 { color: var(--gold-dark); margin-bottom: 8px; font-size: 22px; }
.newsletter-box p { color: var(--text-secondary); margin-bottom: 16px; font-size: 14px; }
.newsletter-box .field { display: flex; gap: 10px; max-width: 500px; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.newsletter-box input { flex: 1; min-width: 200px; padding: 10px 16px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 14px; background: var(--bg-primary); color: var(--text-primary); }
.newsletter-box input:focus { outline: none; border-color: var(--gold); }
.newsletter-box .btn { background: var(--gold); color: #1a1a2e; border: none; padding: 10px 24px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: var(--transition); }
.newsletter-box .btn:hover { box-shadow: 0 4px 16px rgba(240,185,11,0.3); }
.newsletter-box .success { color: var(--green); display: none; margin-top: 10px; }
.newsletter-box .error { color: var(--red); display: none; margin-top: 10px; }
@media (max-width: 480px) {
    .newsletter-box .field { flex-direction: column; }
    .newsletter-box input { min-width: unset; }
}

.loading { text-align: center; padding: 30px; color: var(--text-muted); }
.timezone-note { text-align: center; margin-top: 10px; font-size: 11px; color: var(--text-muted); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .features { grid-template-columns: repeat(2, 1fr); }
    .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    /* Button-row nav (replaces the hamburger dropdown): all links visible directly as a
       horizontal scrollable pill row, one tap to navigate instead of open-menu-then-tap. */
    .hamburger { display: none; }
    .nav-links {
        display: flex;
        width: 100%;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding: 10px 0 12px;
        border-top: 1px solid var(--border-color);
        background: var(--bg-secondary);
    }
    .nav-links li { flex-shrink: 0; list-style: none; }
    .nav-links a {
        display: inline-block;
        padding: 8px 16px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 20px;
        white-space: nowrap;
        font-size: 13px;
    }
    .nav-links a::after { display: none; }
    .nav-links a:hover,
    .nav-links a.active { background: var(--gold); color: #1a1a2e; border-color: var(--gold); }
    .nav-right { display: none; }
    .hero { padding: 40px 0 30px; }
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 15px; }
    .features { grid-template-columns: 1fr 1fr; gap: 10px; padding: 20px 0; }
    .grid { grid-template-columns: 1fr; gap: 14px; padding: 10px 0 30px; }
    .feature-card { padding: 14px; }
    .card { padding: 16px; }
    .footer-content { text-align: center; }
    .footer-bottom-row { justify-content: center; }
    .footer-meta { align-items: center; }
    .signal-header { flex-direction: column; align-items: flex-start; }
    .signal-details span { margin-right: 8px; font-size: 11px; }
}

@media (max-width: 480px) {
    .hero { padding: 30px 0 24px; }
    .hero h1 { font-size: 22px; }
    .hero p { font-size: 13px; }
    .features { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 0; }
    .feature-icon { font-size: 20px; }
    .feature-title { font-size: 12px; }
    .feature-desc { font-size: 10px; }
    .container { padding: 0 12px; }
    .card { padding: 12px; }
    .logo { font-size: 18px; }
    .logo-icon { font-size: 20px; }
    .btn { padding: 8px 20px; font-size: 13px; }
}

/* Recent Blog Posts widget — shared across pages via js/recent-posts.js */
.recent-posts-section { margin: 40px 0; }
.recent-posts-section h2 { margin-bottom: 16px; }
.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.post-card { background: var(--bg-card); border-radius: var(--radius); padding: 18px; border: 1px solid var(--border-color); transition: var(--transition); box-shadow: var(--shadow); }
.post-card:hover { border-color: var(--gold); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.post-card h3 { font-size: 16px; margin-bottom: 6px; }
.post-card h3 a { color: var(--text-primary); text-decoration: none; }
.post-card h3 a:hover { color: var(--gold); }
.post-card p { color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.post-card .post-meta { font-size: 12px; color: var(--text-muted); margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; }
.post-card .ai-badge { font-size: 10px; background: var(--green-light); color: var(--green); padding: 1px 8px; border-radius: 12px; }
@media (max-width: 480px) {
    .post-list { grid-template-columns: 1fr; }
}