/* ================================================================
   TRADEBYBOTS — Shared UI System
   Mirrors Popeye blog theme: Inter font, gold #D4AF37, clean cards
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ---------- CSS VARIABLES ---------- */
:root {
    --gold:          #D4AF37;
    --gold-light:    #e8c84a;
    --gold-dark:     #9B7D23;
    --dark:          #1A110A;
    --dark-2:        #111111;
    --dark-3:        #1C1C1E;
    --bg:            #f7f5f0;
    --bg-card:       #ffffff;
    --bg-subtle:     #faf8f3;
    --text:          #1a1a1a;
    --text-muted:    #6c757d;
    --border:        rgba(0,0,0,.08);
    --border-gold:   rgba(212,175,55,.3);
    --radius-sm:     6px;
    --radius:        12px;
    --radius-lg:     20px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow:        0 4px 16px rgba(0,0,0,.08);
    --shadow-lg:     0 10px 32px rgba(0,0,0,.12);
    --shadow-gold:   0 4px 20px rgba(212,175,55,.2);
    --transition:    all .22s cubic-bezier(.4,0,.2,1);
    --nav-h:         64px;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: var(--transition); }

/* ---------- NAVBAR ---------- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    background: rgba(255,253,245,.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-gold);
    box-shadow: var(--shadow-sm);
}
.site-nav .nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -.02em;
    color: var(--text);
    flex-shrink: 0;
}
.nav-brand .brand-icon {
    width: 32px; height: 32px;
    background: var(--gold);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
    flex-shrink: 0;
}
.nav-brand em { color: var(--gold-dark); font-style: normal; font-weight: 800; }

.nav-links-list {
    display: flex;
    align-items: center;
    gap: .15rem;
    list-style: none;
}
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text);
    cursor: pointer;
    padding: 0;
}
.nav-links-list a {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .35rem .75rem;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    white-space: nowrap;
}
.nav-links-list a:hover {
    color: var(--gold-dark);
    background: rgba(212,175,55,.08);
}
.nav-links-list a.active {
    color: var(--gold-dark);
    background: rgba(212,175,55,.12);
    font-weight: 700;
}
.nav-links-list .nav-cta {
    background: var(--gold);
    color: #000 !important;
    font-weight: 700;
    padding: .35rem 1rem;
    border-radius: 999px;
    margin-left: .5rem;
}
.nav-links-list .nav-cta:hover {
    background: var(--gold-dark);
    color: #fff !important;
}
.nav-lang {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.nav-lang:hover { border-color: var(--gold); color: var(--gold-dark); }

/* ---------- LAYOUT ---------- */
.page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}
.page-wrap-narrow {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ---------- HERO SECTION ---------- */
.hero {
    padding: 5rem 1.5rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(212,175,55,.06) 0%, transparent 60%);
    pointer-events: none;
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .9rem;
    background: rgba(212,175,55,.12);
    border: 1px solid rgba(212,175,55,.3);
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    color: var(--gold-dark);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 1.5rem;
}
.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -.03em;
    color: var(--text);
    margin-bottom: 1.2rem;
}
.hero h1 .accent {
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 50%, var(--gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}
.hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .85rem;
}

/* ---------- SECTION ---------- */
.section { padding: 4rem 0; }
.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-header h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -.025em;
    margin-bottom: .5rem;
}
.section-header p { color: var(--text-muted); font-size: 1rem; }
.section-divider {
    width: 40px; height: 3px;
    background: var(--gold);
    border-radius: 3px;
    margin: .75rem auto 0;
}

/* ---------- CARDS ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.card:hover {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-gold);
}
.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.card-title .card-icon {
    width: 36px; height: 36px;
    background: rgba(212,175,55,.12);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    color: var(--gold-dark);
    flex-shrink: 0;
}

/* Product cards grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.product-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    opacity: 0;
    transition: var(--transition);
}
.product-card:hover {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-gold);
    transform: translateY(-3px);
}
.product-card:hover::after { opacity: 1; }
.product-card.featured {
    border-color: var(--gold);
    border-width: 2px;
    box-shadow: var(--shadow-gold);
}
.product-card.featured::after { opacity: 1; }

.product-badge {
    position: absolute;
    top: 0; right: 0;
    background: var(--gold);
    color: #000;
    font-size: .7rem;
    font-weight: 800;
    padding: .3rem .8rem;
    border-radius: 0 var(--radius-lg) 0 var(--radius-sm);
    letter-spacing: .04em;
    text-transform: uppercase;
}
.product-icon {
    width: 44px; height: 44px;
    background: rgba(212,175,55,.1);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--gold-dark);
    border: 1px solid rgba(212,175,55,.2);
}
.product-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: .5rem;
    line-height: 1.3;
}
.product-desc {
    font-size: .88rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: .75rem;
}
/* Default collapsed: max 2 lines */
.product-desc-short {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: .75rem;
}
/* Expand/collapse toggle button */
.product-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--gold-dark);
    background: none;
    border: none;
    cursor: pointer;
    padding: .1rem 0;
    margin-bottom: .85rem;
    transition: var(--transition);
}
.product-expand-btn:hover { color: var(--gold); }
.expand-icon { font-size: .72rem; transition: var(--transition); }
.product-features {
    list-style: none;
    margin-bottom: 1.2rem;
}
.product-features li {
    font-size: .85rem;
    color: var(--text-muted);
    padding: .2rem 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.product-features li::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--gold);
    border-radius: 50%;
    flex-shrink: 0;
}
.product-footer {
    border-top: 1px solid var(--border);
    padding-top: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
}
.product-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
}
.product-price-label {
    font-size: .72rem;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    margin-bottom: .1rem;
}

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem 1.4rem;
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}
.btn-primary {
    background: var(--gold);
    color: #000;
    box-shadow: 0 3px 12px rgba(212,175,55,.3);
}
.btn-primary:hover {
    background: var(--gold-dark);
    color: #fff;
    box-shadow: 0 4px 16px rgba(212,175,55,.4);
    transform: translateY(-2px);
}
.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold-dark);
    background: rgba(212,175,55,.06);
}
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover { color: var(--gold-dark); background: rgba(212,175,55,.06); }
.btn-sm { padding: .35rem .9rem; font-size: .8rem; }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- FORMS ---------- */
.form-group { margin-bottom: 1.2rem; }
.form-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .4rem;
}
.form-control {
    display: block;
    width: 100%;
    padding: .65rem 1rem;
    font-size: .95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,.15);
}
.form-control::placeholder { color: #aaa; }
.form-control-pill { border-radius: 999px; padding: .65rem 1.2rem; }
.input-group {
    display: flex;
    gap: .6rem;
}
.input-group .form-control { flex: 1; }

/* ---------- ALERTS ---------- */
.alert {
    padding: .85rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    margin-bottom: 1.25rem;
}
.alert-success { background: rgba(16,185,129,.08); border-color: #10b981; color: #065f46; }
.alert-error   { background: rgba(239,68,68,.08);  border-color: #ef4444; color: #991b1b; }
.alert-warning { background: rgba(245,158,11,.08); border-color: #f59e0b; color: #92400e; }
.alert-info    { background: rgba(212,175,55,.08); border-color: var(--gold); color: var(--gold-dark); }

/* ---------- BADGES ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge-success { background: rgba(16,185,129,.12); color: #059669; }
.badge-danger  { background: rgba(239,68,68,.12);  color: #dc2626; }
.badge-warning { background: rgba(245,158,11,.12); color: #d97706; }
.badge-gold    { background: rgba(212,175,55,.15); color: var(--gold-dark); }

/* ---------- TABLE ---------- */
.table-wrap {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-subtle); }
th {
    text-align: left;
    padding: .75rem 1rem;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}
td {
    padding: .85rem 1rem;
    font-size: .88rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-subtle); }
.session-active  { color: #059669; font-weight: 600; }
.session-inactive{ color: var(--text-muted); }

/* ---------- KEY DISPLAY ---------- */
.license-key-display {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: .05em;
    color: var(--gold-dark);
    word-break: break-all;
}

/* ---------- INFO GRID ---------- */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin: 1.25rem 0;
}
.info-item label {
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: .35rem;
}
.info-item .value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

/* ---------- DIVIDER ---------- */
.or-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 1.5rem 0;
}
.or-divider::before, .or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ---------- STORYTELLING / QUOTE BLOCK ---------- */
.quote-block {
    position: relative;
    padding: 1.5rem 1.75rem;
    background: var(--bg-subtle);
    border-left: 4px solid var(--gold);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.quote-block p { font-size: 1rem; color: var(--text-muted); line-height: 1.7; }
.quote-block strong { color: var(--text); }

/* ---------- IB LINKS ---------- */
.ib-box {
    background: var(--bg-subtle);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    position: relative;
    overflow: hidden;
}
.ib-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--gold);
}
.ib-box-text { font-size: .85rem; color: var(--text-muted); margin-bottom: .75rem; line-height: 1.6; }
.ib-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.ib-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .75rem;
    background: rgba(212,175,55,.08);
    border: 1px solid rgba(212,175,55,.3);
    border-radius: var(--radius-sm);
    font-size: .78rem;
    font-weight: 700;
    color: var(--gold-dark);
    text-decoration: none;
    transition: var(--transition);
}
.ib-link:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: #000;
}

/* ---------- FOOTER ---------- */
.site-footer {
    background: var(--bg-subtle);
    border-top: 1px solid var(--border-gold);
    padding: 2rem 1.5rem;
    text-align: center;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-brand {
    font-weight: 800;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .5rem;
    color: var(--text);
}
.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .2rem 1.1rem;
    list-style: none;
    margin: .6rem 0;
}
.footer-links a { font-size: .82rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--gold-dark); }
.footer-copy { font-size: .78rem; color: var(--text-muted); margin-top: .5rem; }

/* Social icon row — separate from nav links, like blog footer */
.footer-social-row {
    display: flex;
    justify-content: center;
    gap: .1rem;
    margin: .4rem 0 .1rem;
}
.footer-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 1rem;
    color: var(--text-muted);
    transition: var(--transition);
}
.footer-social-icon:hover {
    color: var(--gold);
    background: rgba(212,175,55,.1);
    transform: translateY(-2px);
}

/* ---- DARK MODE ---- */
/* Toggle via: <html data-theme="dark"> or add class .dark to body */
/* Currently light-only; enable below by adding [data-theme="dark"] */
@media (prefers-color-scheme: dark) {
    :root {
        --bg:        #111111;
        --bg-card:   #1A110A;
        --bg-subtle: #161006;
        --text:      #f0ede6;
        --text-muted:#9CA3AF;
        --border:    rgba(255,255,255,.07);
        --border-gold: rgba(212,175,55,.25);
    }
    .site-nav { background: rgba(17,17,17,.92); border-bottom-color: rgba(212,175,55,.2); }
    .card, .product-card, .modal-box { background: var(--bg-card); border-color: rgba(255,255,255,.07); }
    .product-expand-btn { color: var(--gold); }
    .footer-social-icon { color: #555; }
    .footer-social-icon:hover { color: var(--gold); }
    thead { background: rgba(255,255,255,.03); }
    .quote-block { background: rgba(255,255,255,.04); }
    .ib-box { background: rgba(212,175,55,.05); }
    .form-control { background: #1a1a1a; color: var(--text); border-color: rgba(255,255,255,.1); }
    .form-control::placeholder { color: #555; }
    select { background: #1a1a1a !important; color: var(--text) !important; }
}

/* ---------- MODAL ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    border-top: 3px solid var(--gold);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.modal-title { font-size: 1.2rem; font-weight: 800; }
.modal-subtitle { font-size: .85rem; color: var(--text-muted); margin-top: .25rem; }
.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--text-muted);
    padding: .2rem;
    line-height: 1;
    flex-shrink: 0;
}
.modal-close:hover { color: var(--text); }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .products-grid { grid-template-columns: 1fr; }
    .info-grid     { grid-template-columns: 1fr; }
    .hero { padding: 3rem 1rem 2.5rem; }
    .hero h1 { font-size: 1.9rem; }
    
    .mobile-menu-toggle { display: block; }
    .nav-links-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: .5rem;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }
    .nav-links-list.show { display: flex; }
    .nav-links-list a { padding: .75rem 1rem; border-radius: var(--radius-sm); }
}
@media (max-width: 480px) {
    .input-group  { flex-direction: column; }
    .hero-actions { flex-direction: column; align-items: center; }
}
