/* Pro Deep Dive — the structured report's visual language.
 *
 * Lifted verbatim out of injectDeepDiveStyles() in static/js/modules/ui.js so
 * the dashboard and the public product pages paint the same component from one
 * file. The dashboard still links it at runtime (that function now injects a
 * <link>); templates/landing.html and templates/products/market_intelligence.html
 * link it in <head>.
 *
 * Aligned with the Tradability Matrix.
 */
#deep-dive-section {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.08), transparent 35%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.96));
    box-shadow: 0 18px 60px rgba(2, 6, 23, 0.34);
    padding: 1.25rem;
}

#deep-dive-section::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 32%);
}

#deep-dive-content-area {
    position: relative;
    z-index: 1;
}

#deep-dive-status {
    min-height: 1rem;
    margin-bottom: 0.75rem;
}

.deep-dive-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.deep-dive-hero,
.deep-dive-card,
.deep-dive-loading {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.70);
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.22);
}

.deep-dive-hero::before,
.deep-dive-card::before,
.deep-dive-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 34%);
}

.deep-dive-hero,
.deep-dive-loading {
    padding: 1.1rem;
}

.deep-dive-card {
    padding: 1rem;
}

.deep-dive-hero-grid,
.deep-dive-grid,
.deep-dive-stat-grid {
    display: grid;
    gap: 0.9rem;
}

.deep-dive-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.deep-dive-stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

@media (min-width: 960px) {
    .deep-dive-hero-grid {
        grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.95fr);
    }
}

.deep-dive-eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 0.9);
}

.deep-dive-headline {
    margin-top: 0.5rem;
    font-size: 1.25rem;
    line-height: 1.3;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
}

.deep-dive-summary {
    margin-top: 0.75rem;
    max-width: 62ch;
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgba(203, 213, 225, 0.9);
}

.deep-dive-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.deep-dive-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(2, 6, 23, 0.50);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.9);
}

.deep-dive-chip::before {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.85);
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

.deep-dive-chip--bull {
    border-color: rgba(52, 211, 153, 0.24);
    background: rgba(6, 95, 70, 0.22);
    color: #d1fae5;
}

.deep-dive-chip--bull::before {
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16);
}

.deep-dive-chip--bear {
    border-color: rgba(251, 113, 133, 0.24);
    background: rgba(136, 19, 55, 0.24);
    color: #ffe4e6;
}

.deep-dive-chip--bear::before {
    background: #fb7185;
    box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.16);
}

.deep-dive-chip--neutral {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(30, 41, 59, 0.58);
    color: #e2e8f0;
}

.deep-dive-chip--neutral::before {
    background: #94a3b8;
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.14);
}

.deep-dive-stat,
.deep-dive-tile {
    position: relative;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 23, 42, 0.60);
    padding: 1rem;
}

.deep-dive-stat-label,
.deep-dive-tile-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 0.9);
}

.deep-dive-stat-value,
.deep-dive-tile-value {
    margin-top: 0.5rem;
    color: #f1f5f9;
    font-weight: 600;
    line-height: 1.4;
}

.deep-dive-stat-value {
    font-size: 1rem;
}

.deep-dive-tile-meta {
    margin-top: 0.375rem;
    color: rgba(148, 163, 184, 0.8);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.deep-dive-tone-bull {
    border-color: rgba(52, 211, 153, 0.20);
    background: linear-gradient(180deg, rgba(6, 78, 59, 0.18), rgba(2, 6, 23, 0.35));
}

.deep-dive-tone-bear {
    border-color: rgba(251, 113, 133, 0.20);
    background: linear-gradient(180deg, rgba(136, 19, 55, 0.20), rgba(2, 6, 23, 0.35));
}

.deep-dive-tone-base {
    border-color: rgba(125, 211, 252, 0.15);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.55), rgba(2, 6, 23, 0.38));
}

.deep-dive-tone-caution {
    border-color: rgba(251, 191, 36, 0.18);
    background: linear-gradient(180deg, rgba(120, 53, 15, 0.16), rgba(2, 6, 23, 0.35));
}

.deep-dive-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(15, 23, 42, 0.9);
}

.deep-dive-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #22c55e);
}

.deep-dive-progress--warm > span {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}

.deep-dive-progress--danger > span {
    background: linear-gradient(90deg, #fb7185, #ef4444);
}

.deep-dive-section-header {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.deep-dive-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(2, 6, 23, 0.55);
    color: #7dd3fc;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.deep-dive-icon--emerald { color: #6ee7b7; }
.deep-dive-icon--amber { color: #fcd34d; }
.deep-dive-icon--rose { color: #fda4af; }
.deep-dive-icon--violet { color: #c4b5fd; }
.deep-dive-icon--cyan { color: #67e8f9; }
.deep-dive-icon--slate { color: #cbd5e1; }

.deep-dive-section-title {
    margin: 0.12rem 0 0;
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
}

.deep-dive-section-subtitle {
    margin-top: 0.2rem;
    color: rgba(148, 163, 184, 0.78);
    font-size: 0.84rem;
    line-height: 1.5;
}

.deep-dive-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.deep-dive-list-item {
    position: relative;
    padding-left: 1rem;
    color: rgba(226, 232, 240, 0.9);
    line-height: 1.6;
}

.deep-dive-list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62rem;
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.65);
}

.deep-dive-empty {
    color: rgba(148, 163, 184, 0.62);
    line-height: 1.6;
}

.deep-dive-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.deep-dive-tag {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.62);
    padding: 0.38rem 0.72rem;
    font-size: 0.78rem;
    color: rgba(226, 232, 240, 0.88);
}

.deep-dive-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.7);
    padding: 0.22rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: #e2e8f0;
    text-transform: capitalize;
}

.deep-dive-pill--bull {
    border-color: rgba(52, 211, 153, 0.2);
    background: rgba(6, 78, 59, 0.34);
    color: #d1fae5;
}

.deep-dive-pill--bear {
    border-color: rgba(251, 113, 133, 0.2);
    background: rgba(136, 19, 55, 0.32);
    color: #ffe4e6;
}

.deep-dive-pill--caution {
    border-color: rgba(251, 191, 36, 0.2);
    background: rgba(120, 53, 15, 0.34);
    color: #fde68a;
}

.deep-dive-pill--neutral {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(30, 41, 59, 0.72);
    color: #e2e8f0;
}

.deep-dive-loading {
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 35%),
        radial-gradient(circle at top right, rgba(52, 211, 153, 0.12), transparent 32%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.96));
}

.deep-dive-loader-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.deep-dive-loader-mark {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.9), rgba(52, 211, 153, 0.92));
    color: #fff;
    box-shadow: 0 12px 30px rgba(56, 189, 248, 0.18);
}

.deep-dive-loader-ping {
    position: absolute;
    right: -0.08rem;
    bottom: -0.08rem;
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 999px;
    background: #34d399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
    animation: deepDivePing 1.9s infinite;
}

.deep-dive-loader-title {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
}

.deep-dive-loader-copy {
    margin-top: 0.25rem;
    color: rgba(148, 163, 184, 0.84);
    font-size: 0.9rem;
}

.deep-dive-loader-bar {
    position: relative;
    height: 0.42rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.deep-dive-loader-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transform: translateX(-100%);
    animation: deepDiveShimmer 2s infinite;
}

.deep-dive-loader-bar span {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #34d399);
}

.deep-dive-loader-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.85rem;
    font-size: 0.78rem;
    color: rgba(148, 163, 184, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.deep-dive-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
    margin-top: 1rem;
}

.deep-dive-skeleton-card {
    height: 4.8rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(2, 6, 23, 0.42);
    overflow: hidden;
    position: relative;
}

.deep-dive-skeleton-card::after,
.deep-dive-skeleton-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transform: translateX(-100%);
    animation: deepDiveShimmer 2s infinite;
}

.deep-dive-skeleton-lines {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.deep-dive-skeleton-line {
    position: relative;
    height: 0.75rem;
    border-radius: 999px;
    background: rgba(51, 65, 85, 0.52);
    overflow: hidden;
}

.deep-dive-skeleton-line.short { width: 72%; }
.deep-dive-skeleton-line.mid { width: 88%; }

/* Deeper Analysis Progressive Disclosure */
.deeper-analysis-preview {
    position: relative;
    max-height: 120px;
    overflow: hidden;
}

.deeper-analysis-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, rgb(17 24 39 / 0.9));
    pointer-events: none;
}

.deeper-analysis-full {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#deeper-analysis-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

#deep-dive-skeleton .animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes deepDivePing {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(52, 211, 153, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    }
}

@keyframes deepDiveShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}
