/* ================================================================
   STOCK DETAIL PAGE — PAGE-SPECIFIC STYLES
   Extracted from stock_detail.html
   ================================================================ */

.chart-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.chart-period-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.price-chart-container {
    position: relative;
    width: 100%;
    height: 420px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.financial-table {
    width: 100%;
    min-width: 680px;
}

#priceChart {
    width: 100% !important;
    height: 100% !important;
}

.financial-table th:first-child,
.financial-table td:first-child {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
}

/* ================================================================
   MOBILE
   ================================================================ */

@media (max-width: 768px) {

    .chart-controls {
        display: block;
    }

    .chart-controls .section-title {
        width: 100%;
        margin-bottom: 12px;
    }

    .chart-period-buttons {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .chart-period-buttons .chart-btn {
        flex: 0 0 auto;
    }

    .price-chart-container {
        height: 300px;
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .financial-table {
        min-width: 680px;
    }

    .analyst-top-layout {
        display: block;
        width: 100%;
    }

    .analyst-table-panel,
    .analyst-consensus-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .analyst-consensus-panel {
        margin-top: 20px;
    }
}

/* ==============================================================================
   4. STOCK DETAIL PAGE (`stock_detail.html`)
   ============================================================================== */


.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    width: 100%;
}



.stock-header-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    flex-shrink: 0;
}

.stock-header-box {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 200px;
}

.header-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.header-metric-row:last-child {
    margin-bottom: 0;
}

.header-metric-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    text-align: right;
}

.date-subtext {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
}

/* Snapshot Grid */
.snapshot-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.snapshot-grid .metric-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 6px;
    padding: 16px;
    text-align: center;
}

.snapshot-grid .metric-label {
    font-size: 18px;
    font-weight: 700;
    color: #1e1f20;
    text-transform: none;
    letter-spacing: 0.5px;
}

.snapshot-grid .metric-value {
    font-size: 22px;
    font-weight: 675;
    margin-top: 10px;
}

.post-results-rating {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted-text);
    font-weight: 600;
}

/* Chart Controls */
.chart-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.chart-controls h2 {
    margin-bottom: 0;
    margin-right: 16px;
}

.chart-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--muted-text);
}

.chart-btn:hover,
.chart-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* Recommendation Rationale */
.theme-box {
    background: #eff6ff;
    border-left: 4px solid var(--primary-color);
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.theme-text {
    font-size: 18px;
    font-weight: 700;
    color: #1e40af;
    margin: 0;
}

.narrative-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.coming-soon {
    font-size: 12px;
    color: var(--muted-text);
    font-style: italic;
    margin-top: 10px;
}

.rationale-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tailwind-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 20px;
}

.tailwind-box h3 {
    color: #166534;
    margin-top: 0;
}

.headwind-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 20px;
}

.headwind-box h3 {
    color: #991b1b;
    margin-top: 0;
}

.tailwind-box ul, .headwind-box ul {
    padding-left: 20px;
    margin: 0;
}

.tailwind-box li, .headwind-box li {
    color: #374151;
    line-height: 1.6;
    margin-bottom: 6px;
}

/* Clean Key Parameters Grid */
.key-parameters-card .key-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .key-parameters-card .key-grid {
        grid-template-columns: 1fr;
    }
}


.key-parameters-card .kp-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Header / Title */
.kp-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color); /* Uses standard dark slate color */
    text-align: center;
}

/* Neutral Main Value Display */
.kp-status {
    font-size: 20px;
    font-weight: 700;
    color: #2563eb;
    text-align: center;
    margin: 8px 0 12px 0;
}

.kp-divider {
    border-top: 1px dashed var(--border-color);
    margin-bottom: 10px;
}

/* Footer & Secondary Metrics */
.kp-footer {
    font-size: 13px;
    color: var(--muted-text);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.kp-label {
    font-weight: 500;
    color: var(--muted-text);
}

.kp-value {
    font-weight: 600;
    color: var(--text-color);
}

.kp-sep {
    margin: 0 4px;
    color: #cbd5e1;
}

/* Financial Table */
.financial-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.financial-table th, .financial-table td {
    padding: 12px 16px;
    font-size: 17px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.financial-table th:last-child, .financial-table td:last-child {
    border-right: none;
}

.financial-table th:first-child, .financial-table td:first-child {
    text-align: left;
    font-weight: 520;
    width: 320px;
    background: #ffffff;
}

.financial-table .actuals-header {
    background-color: #f1f5f9;
    color: #334155;
    font-weight: 700;
}

.financial-table .forecasts-header {
    background-color: #dbeafe;
    color: #1e40af;
    font-weight: 700;
}

/* About Details */
.about-section summary {
    font-weight: 700;
    cursor: pointer;
    color: var(--primary-color);
    padding: 8px 0;
}

.about-content {
    margin-top: 12px;
    line-height: 1.6;
    color: #334155;
}


/* ==============================================================================
   12. STOCK DETAIL HEADER & SNAPSHOT STYLES (FULL-WIDTH SPREAD)
   ============================================================================== */

/* Stock Header - Structure of the label (DH) */
.stock-header {
    
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.stock-header-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
    width: 100%;
}

/* Ticker Name  - Ticker Title (DH) */
.stock-header-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    flex: 1 1 auto;
    margin: 0;
}
/* Industry Label - (DH) */
.stock-header-title .industry-tag {
    font-size: 19px;
    text-decoration: none;
    color: var(--muted-text);
}

.stock-header-title .industry-tag strong {
    color: var(--primary-color);
}

.industry-tag {
    font-size: 20px;
    color: #64748b;
    margin-left: 12px;
    text-decoration: none;
}

/* Spread 3 Boxes Full-Width Across Container */
.stock-header-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

.stock-header-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.header-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    width: 100%;
}

.header-metric-label {
    color: #587dcd;
    font-weight: 600;
}

.header-metric-label {
    font-size: 18px;
    color: var(--muted-text);
}

.header-metric-val {
    font-weight: 700;
    color: #0f172a;
}

.cmp-large {
    font-size: 22px;
    font-weight: 700;
    color: #2563eb !important; /* Modern Royal Blue */
}

/* Color Rules for CAGR & Changes */
.val-green {
    color: #16a34a !important;
    font-weight: 700;
}

.val-red {
    color: #dc2626 !important;
    font-weight: 700;
}

/* Forecast Recommendation Text Colors (No Badges) */
.recommendation-badge {
    padding: 0;
    background: transparent !important;
    border-radius: 0;
    font-size: 22px;
    font-weight: 700;
    text-transform: capitalize;
}

/* Green for Buy & Strong Buy */
.recommendation-badge.buy,
.recommendation-badge.strong-buy,
.recommendation-badge.strong_buy {
    color: #15803d !important; /* Green */
}

/* Orange for Hold */
.recommendation-badge.hold {
    color: #c2410c !important; /* Orange */
}

/* Red for Sell & Strong Sell */
.recommendation-badge.sell,
.recommendation-badge.strong-sell,
.recommendation-badge.strong_sell {
    color: #b91c1c !important; /* Red */
}

.date-subtext {
    font-size: 14px;
    color: #94a3b8;
}

/* Responsive Grid Adjustment */
@media (max-width: 900px) {
    .stock-header-grid {
        grid-template-columns: 1fr;
    }
}

.vista-outlook-header h2 {
    margin: 0;
}

.btn-technical {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 9999;
    pointer-events: auto;
    cursor: pointer;

    background-color: #2563eb;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}


/* ==============================================================================
   STOCK 360 DASHBOARD PANELS
   ============================================================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.dashboard-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

.dashboard-card.full-width {
    grid-column: 1 / -1;
}

.dashboard-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f7;
}

.dashboard-table {
    width: 100%;
}

.dashboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid #f8fafc;
}

.dashboard-row:last-child {
    border-bottom: none;
}

.dashboard-label {
    color: var(--muted-text);
    font-size: 15px;
    font-weight: 500;
}

.dashboard-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
    text-align: right;
}

.consensus-box{

    margin-top:20px;
    display:flex;
    justify-content:space-around;
    background:#f7f9fc;
    border:1px solid #d9e2ef;
    border-radius:8px;
    padding:18px;
    text-align:center;
}

.consensus-box div{

    flex:1;

}

/* ==========================================
   Analyst Recommendation Styles
========================================== */

.buy-label{

    color:#16a34a;
    font-weight:600;

}

.sell-label{

    color:#dc2626;
    font-weight:600;

}

.hold-label{

    color:#d97706;
    font-weight:600;

}

/* ==========================================
   Analyst View
========================================== */

.analyst-view-grid{

    display:grid;

    grid-template-columns:220px 1fr;

    gap:24px;

    margin-top:15px;

}

.analyst-summary-panel{

    border-right:1px solid #e5e7eb;

    padding-right:18px;

}

.summary-block{

    margin-bottom:28px;

}

.summary-label{

    font-size:13px;

    font-weight:700;

    color:#6b7280;

    text-transform:uppercase;

    margin-bottom:8px;

}

.summary-value{

    font-size:15px;

    line-height:1.6;

}

.analyst-narrative-panel{

    padding-left:5px;

}

.analyst-text{

    font-size:15px;

    line-height:1.8;

    text-align:justify;

    color:#374151;

}

/* ===========================================
   Analyst Intelligence
=========================================== */

.analyst-top-layout{
    display:flex;
    gap:24px;
    align-items:flex-start;
}

.analyst-table-panel{
    flex:4;
}

.analyst-consensus-panel{
    flex:1;
    border:1px solid #dbe3ef;
    border-radius:10px;
    padding:20px;
    background:#fff;
}

.consensus-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:14px 0;
    border-bottom:1px solid #edf1f7;
}

.consensus-row:last-child{
    border-bottom:none;
}

.consensus-label{
    font-size:13px;
    color:#6b7280;
    font-weight:600;
}

.consensus-value{
    font-size:18px;
    font-weight:700;
}

.analyst-narrative-card{
    width:100%;
}

.narrative-heading{
    font-size:18px;
    font-weight:700;
    margin-bottom:16px;
}

.narrative-text{
    font-size:15px;
    line-height:1.8;
    color:#374151;
}


.screeners-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: #2563eb;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.screeners-button:hover {
    background: #1d4ed8;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ==========================================================
   STOCK DETAIL - MOBILE OVERRIDES
   ========================================================== */

@media screen and (max-width: 768px) {

    /* Stock Snapshot */
    .card .snapshot-grid {
        grid-template-columns: 1fr !important;
    }

    .card .snapshot-grid .metric-card {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Key Parameters */
    .key-parameters-card .key-grid {
        grid-template-columns: 1fr !important;
    }

    .key-parameters-card .key-grid .kp-card {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Why We Like / Things To Watch */
    .rationale-grid {
        grid-template-columns: 1fr !important;
    }

    /* Analyst Recommendations */
    .analyst-top-layout {
        display: block;
        width: 100%;
    }

}

.financial-snapshot-table {
    margin-top: 20px;
}