@import url("https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

/* TradeAnalyzer.Pro — Symbol Detail (Crypto + Markets) */
body.symbol-detail-page {
    --sd-bg: #070b14;
    --sd-panel: #0d1524;
    --sd-card: #111a2b;
    --sd-line: rgba(148, 163, 184, 0.18);
    --sd-text: #e8eef7;
    --sd-muted: #94a3b8;
    --sd-cyan: #38bdf8;
    --sd-blue: #0ea5e9;
    --sd-gold: #eab308;
    --sd-green: #34d399;
    --sd-red: #f87171;
    --sd-radius: 16px;
    --sd-display: "Sora", system-ui, sans-serif;
    --sd-body: "IBM Plex Sans", system-ui, sans-serif;

    margin: 0 !important;
    padding: 70px 0 0 !important;
    min-height: 100vh;
    display: flex !important;
    flex-direction: column !important;
    color: var(--sd-text) !important;
    font-family: var(--sd-body) !important;
    line-height: 1.65;
    background:
        radial-gradient(1200px 600px at 12% -10%, rgba(14, 165, 233, 0.15), transparent 55%),
        radial-gradient(900px 500px at 90% 8%, rgba(234, 179, 8, 0.07), transparent 50%),
        var(--sd-bg) !important;
    overflow-x: hidden;
}

body.symbol-detail-page h1,
body.symbol-detail-page h2,
body.symbol-detail-page h3,
body.symbol-detail-page .sd-page-title {
    font-family: var(--sd-display) !important;
    letter-spacing: -0.02em;
    color: var(--sd-text) !important;
}

body.symbol-detail-page .page-wrap {
    width: min(1180px, calc(100% - 2rem)) !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
    padding: 1.5rem 0 3rem !important;
    flex: 1;
    box-sizing: border-box;
}

body.symbol-detail-page .panel {
    position: relative;
    /* visible: absolute autocomplete must not be clipped by the hero panel */
    overflow: visible;
    margin-bottom: 1.15rem !important;
    padding: 1.35rem 1.45rem !important;
    border: 1px solid var(--sd-line) !important;
    border-radius: 20px !important;
    background: rgba(13, 21, 36, 0.92) !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.26) !important;
}

body.symbol-detail-page .panel-hero,
body.symbol-detail-page .panel--hero {
    background:
        radial-gradient(700px 260px at 0% 0%, rgba(14, 165, 233, 0.18), transparent 56%),
        radial-gradient(620px 260px at 100% 0%, rgba(234, 179, 8, 0.09), transparent 55%),
        rgba(13, 21, 36, 0.92) !important;
    border-top: 1px solid var(--sd-line) !important;
}

body.symbol-detail-page .panel-hero::before,
body.symbol-detail-page .panel--hero::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--sd-cyan), var(--sd-gold), transparent);
}

body.symbol-detail-page .panel h1,
body.symbol-detail-page .sd-page-title {
    margin: 0 0 0.65rem !important;
    font-size: clamp(1.45rem, 3vw, 2.2rem) !important;
    font-weight: 800 !important;
    line-height: 1.15;
}

body.symbol-detail-page .panel h1 i,
body.symbol-detail-page .sd-page-title i {
    margin-inline-end: 0.45rem;
    color: var(--sd-cyan) !important;
}

body.symbol-detail-page .muted,
body.symbol-detail-page .sd-page-lead {
    color: var(--sd-muted) !important;
    margin: 0 0 1.1rem !important;
    font-size: clamp(0.92rem, 1.5vw, 1.05rem) !important;
    line-height: 1.6 !important;
    max-width: 78ch;
}

body.symbol-detail-page .header-grid {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 0.85rem !important;
    align-items: end !important;
}

body.symbol-detail-page .header-grid label,
body.symbol-detail-page .header-grid .form-label {
    display: block;
    margin-bottom: 0.4rem !important;
    color: var(--sd-muted) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
}

body.symbol-detail-page .page-wrap .form-control,
body.symbol-detail-page #symbolInput {
    min-height: 46px !important;
    padding: 0.7rem 1rem !important;
    border: 1px solid var(--sd-line) !important;
    border-radius: 999px !important;
    background: rgba(17, 26, 43, 0.9) !important;
    color: var(--sd-text) !important;
    box-shadow: none !important;
    font: 500 0.95rem var(--sd-body) !important;
}

body.symbol-detail-page .page-wrap .form-control:focus,
body.symbol-detail-page #symbolInput:focus {
    border-color: rgba(56, 189, 248, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14) !important;
    background: rgba(17, 26, 43, 0.98) !important;
    color: var(--sd-text) !important;
}

body.symbol-detail-page .page-wrap .form-control::placeholder {
    color: rgba(148, 163, 184, 0.7) !important;
}

body.symbol-detail-page #loadBtn {
    min-height: 46px !important;
    padding: 0.65rem 1.25rem !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    border-radius: 999px !important;
    background: rgba(14, 165, 233, 0.18) !important;
    color: #7dd3fc !important;
    font-weight: 700 !important;
    box-shadow: none !important;
    transform: none !important;
}

body.symbol-detail-page #loadBtn:hover {
    background: rgba(14, 165, 233, 0.28) !important;
    color: #bae6fd !important;
    transform: none !important;
    filter: none !important;
}

body.symbol-detail-page .snapshot-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0.85rem !important;
    flex-wrap: wrap !important;
}

body.symbol-detail-page .snapshot-header h2 {
    margin: 0 !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: var(--sd-text) !important;
}

body.symbol-detail-page #openDivergence,
body.symbol-detail-page .btn-outline-primary {
    min-height: 42px !important;
    padding: 0.55rem 1rem !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    border-radius: 999px !important;
    background: rgba(56, 189, 248, 0.08) !important;
    color: var(--sd-cyan) !important;
    font-weight: 700 !important;
}

body.symbol-detail-page #openDivergence:hover,
body.symbol-detail-page .btn-outline-primary:hover {
    background: rgba(56, 189, 248, 0.16) !important;
    border-color: rgba(56, 189, 248, 0.55) !important;
    color: #7dd3fc !important;
}

body.symbol-detail-page .cards {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0.9rem !important;
}

body.symbol-detail-page .tf-card {
    min-width: 0 !important;
    padding: 1rem 1.05rem !important;
    border: 1px solid var(--sd-line) !important;
    border-radius: 14px !important;
    background: rgba(17, 26, 43, 0.88) !important;
    box-shadow: none !important;
    transform: none !important;
    transition: none !important;
}

body.symbol-detail-page .tf-card:hover {
    border-color: var(--sd-line) !important;
    box-shadow: none !important;
    transform: none !important;
}

body.symbol-detail-page .tf-card:nth-child(1) { border-top: 2px solid var(--sd-green) !important; }
body.symbol-detail-page .tf-card:nth-child(2) { border-top: 2px solid var(--sd-cyan) !important; }
body.symbol-detail-page .tf-card:nth-child(3) { border-top: 2px solid var(--sd-gold) !important; }
body.symbol-detail-page .tf-card:nth-child(4) { border-top: 2px solid var(--sd-red) !important; }

body.symbol-detail-page .tf-title {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.65rem !important;
    border-bottom: 1px solid var(--sd-line) !important;
    flex-wrap: wrap !important;
}

body.symbol-detail-page .tf-title h3 {
    margin: 0 !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    color: var(--sd-text) !important;
    line-height: 1.3;
    word-break: break-word;
}

body.symbol-detail-page .pill {
    border-radius: 999px !important;
    padding: 0.28rem 0.55rem !important;
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    white-space: nowrap;
}

body.symbol-detail-page .sig-long {
    background: rgba(52, 211, 153, 0.12) !important;
    color: #a7f3d0 !important;
    border: 1px solid rgba(52, 211, 153, 0.3) !important;
}

body.symbol-detail-page .sig-short {
    background: rgba(248, 113, 113, 0.12) !important;
    color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, 0.3) !important;
}

body.symbol-detail-page .sig-neutral {
    background: rgba(148, 163, 184, 0.1) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
}

body.symbol-detail-page .kv {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 0.25rem 0.75rem !important;
    padding: 0.4rem 0 !important;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.16) !important;
    font-size: 0.86rem !important;
    align-items: baseline !important;
}

body.symbol-detail-page .kv:last-child {
    border-bottom: 0 !important;
}

body.symbol-detail-page .kv .muted {
    margin: 0 !important;
    font-size: 0.8rem !important;
}

body.symbol-detail-page .kv strong {
    color: var(--sd-text) !important;
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums;
}

body.symbol-detail-page .history-wrap {
    max-height: 48vh;
    overflow: auto;
    border: 1px solid var(--sd-line) !important;
    border-radius: 14px !important;
    background: rgba(17, 26, 43, 0.7) !important;
}

body.symbol-detail-page .history-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--sd-text) !important;
    background: transparent !important;
}

body.symbol-detail-page .history-table th {
    padding: 0.65rem 0.55rem !important;
    border-bottom: 1px solid var(--sd-line) !important;
    background: rgba(7, 11, 20, 0.65) !important;
    color: var(--sd-muted) !important;
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
}

body.symbol-detail-page .history-table td {
    padding: 0.55rem !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12) !important;
    color: #cbd5e1 !important;
    font-size: 0.86rem !important;
}

body.symbol-detail-page .history-table tbody tr,
body.symbol-detail-page .history-table tbody tr:nth-child(even),
body.symbol-detail-page .history-table tbody tr:hover {
    background: transparent !important;
}

body.symbol-detail-page .footer-simple {
    margin-top: auto !important;
    padding: 1.25rem 1rem !important;
    border-top: 1px solid var(--sd-line) !important;
    background: transparent !important;
    color: var(--sd-muted) !important;
    text-align: center;
}

body.symbol-detail-page .footer-simple p {
    margin: 0;
    font-size: 0.88rem;
}

@media (max-width: 1100px) {
    body.symbol-detail-page .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.symbol-detail-page .header-grid {
        grid-template-columns: 1fr !important;
    }

    body.symbol-detail-page #loadBtn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    body.symbol-detail-page .page-wrap {
        width: min(100% - 1rem, 1180px) !important;
        padding-top: 1rem !important;
    }

    body.symbol-detail-page .panel {
        padding: 1.1rem !important;
    }

    body.symbol-detail-page .cards {
        grid-template-columns: 1fr !important;
        gap: 0.7rem !important;
    }

    body.symbol-detail-page .snapshot-header {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.symbol-detail-page .snapshot-header .btn,
    body.symbol-detail-page #openDivergence,
    body.symbol-detail-page #loadBtn {
        width: 100%;
    }
}

@media (max-width: 380px) {
    body.symbol-detail-page .tf-title {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
}

/* RTL */
html[dir="rtl"] body.symbol-detail-page .page-wrap,
html[dir="rtl"] body.symbol-detail-page .panel,
html[dir="rtl"] body.symbol-detail-page .snapshot-header,
html[dir="rtl"] body.symbol-detail-page .tf-title {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] body.symbol-detail-page .kv {
    direction: rtl;
}

html[dir="rtl"] body.symbol-detail-page .panel h1 i,
html[dir="rtl"] body.symbol-detail-page .sd-page-title i {
    margin-inline-end: 0.45rem;
    margin-inline-start: 0;
}

/* Custom symbol autocomplete (replaces native datalist UI) */
body.symbol-detail-page .sd-ac-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
}

body.symbol-detail-page .sd-ac-wrap #symbolInput {
    width: 100%;
}

body.symbol-detail-page .sd-ac-dropdown {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    max-height: min(280px, 42vh);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--sd-line);
    border-radius: 14px;
    background: rgba(13, 21, 36, 0.98);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
}

body.symbol-detail-page .sd-ac-dropdown[hidden] {
    display: none !important;
}

body.symbol-detail-page .sd-ac-list {
    overflow-y: auto;
    max-height: min(280px, 42vh);
    padding: 0.35rem;
    overscroll-behavior: contain;
}

body.symbol-detail-page .sd-ac-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.8rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--sd-text);
    font: 600 0.92rem var(--sd-body);
    text-align: start;
    cursor: pointer;
}

body.symbol-detail-page .sd-ac-item:hover,
body.symbol-detail-page .sd-ac-item.is-active {
    background: rgba(56, 189, 248, 0.12);
    color: #e0f2fe;
}

body.symbol-detail-page .sd-ac-symbol mark {
    background: rgba(234, 179, 8, 0.22);
    color: #fde68a;
    border-radius: 3px;
    padding: 0 0.1em;
}

body.symbol-detail-page .sd-ac-meta {
    color: var(--sd-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.8;
}

body.symbol-detail-page .sd-ac-empty {
    padding: 0.9rem 1rem;
    color: var(--sd-muted);
    font-size: 0.88rem;
}

html[dir="rtl"] body.symbol-detail-page .sd-ac-item {
    text-align: right;
}
