/* ============================================
   MOBILE CHART SECTION (stock page)
   Matches desktop chart: price display, period
   filters, legend, line colours, touch-friendly
   ============================================ */

/* ---------------------------------------------------------------------------
   Mobile top nav tabs (Overview | Financials | Dividend) – above header
   --------------------------------------------------------------------------- */
.mobile-nav-tabs {
    padding: 10px 16px 0;
    background: transparent;
}

.mobile-nav-tabs .nav-tabs-container {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav-tabs .mobile-tab {
    flex: 1;
    min-width: 0;
    padding: 10px 12px 12px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.mobile-nav-tabs .mobile-tab:hover {
    color: rgba(255, 255, 255, 0.85);
}

.mobile-nav-tabs .mobile-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* When using top nav, hide the inner 6-tab nav inside mobile-tabs */
.mobile-hide-inner-nav .stock-mobile-tabs {
    display: none !important;
}

.mobile-hide-inner-nav .stock-mobile-tab-content {
    padding-top: 0;
}

/* Only apply when wrapper is visible (mobile) */
.premium-mobile-chart-wrapper {
    padding: 12px 16px 16px;
    background: transparent;
}

/* ---------------------------------------------------------------------------
   Header row: price micro card + period buttons
   --------------------------------------------------------------------------- */
.premium-mobile-chart-wrapper .chart-info-overlay {
    flex-shrink: 0;
    min-width: 0;
}

.premium-mobile-chart-wrapper .chart-price-micro-card {
    background: transparent;
    border: none;
    padding: 0;
}

.premium-mobile-chart-wrapper .chart-current-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 0.125rem;
}

.premium-mobile-chart-wrapper .chart-price-change {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.premium-mobile-chart-wrapper .chart-price-change .change-value,
.premium-mobile-chart-wrapper .chart-price-change .change-percent {
    color: rgba(255, 255, 255, 0.7);
}

.premium-mobile-chart-wrapper .chart-price-change.positive .change-value,
.premium-mobile-chart-wrapper .chart-price-change.positive .change-percent {
    color: #22c55e;
}

.premium-mobile-chart-wrapper .chart-price-change.negative .change-value,
.premium-mobile-chart-wrapper .chart-price-change.negative .change-percent {
    color: #ef4444;
}

/* Period filters – compact, wrap on small screens */
.premium-mobile-chart-wrapper .mobile-period-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
}

.premium-mobile-chart-wrapper .mobile-period-btn,
.premium-mobile-chart-wrapper .period-btn-professional {
    min-width: 32px;
    padding: 0.2rem 0.4rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.premium-mobile-chart-wrapper .mobile-period-btn:hover,
.premium-mobile-chart-wrapper .period-btn-professional:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
}

.premium-mobile-chart-wrapper .mobile-period-btn.active,
.premium-mobile-chart-wrapper .period-btn-professional.active {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.5);
    color: #22c55e;
}

/* ---------------------------------------------------------------------------
   Chart container & canvas
   --------------------------------------------------------------------------- */
.premium-mobile-chart-wrapper .premium-chart-container {
    position: relative;
    width: 100%;
    height: 280px;
    min-height: 240px;
    margin: 0 0 12px 0;
    border-radius: 10px;
    overflow: hidden;
}

.premium-mobile-chart-wrapper .premium-chart-canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    touch-action: pan-y;
}

/* Overlay elements (touch indicator, crosshair) – above canvas */
.premium-mobile-chart-wrapper .chart-overlay-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
}

.premium-mobile-chart-wrapper .price-line-indicator {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(
        to bottom,
        rgba(142, 170, 255, 0) 0%,
        rgba(142, 170, 255, 0.6) 15%,
        rgba(142, 170, 255, 0.6) 85%,
        rgba(142, 170, 255, 0) 100%
    );
    display: none;
}

.premium-mobile-chart-wrapper .chart-crosshair {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
}

.premium-mobile-chart-wrapper .crosshair-vertical,
.premium-mobile-chart-wrapper .crosshair-horizontal {
    position: absolute;
    background: rgba(142, 170, 255, 0.4);
}

.premium-mobile-chart-wrapper .crosshair-vertical {
    width: 1px;
    top: 0;
    bottom: 0;
}

.premium-mobile-chart-wrapper .crosshair-horizontal {
    height: 1px;
    left: 0;
    right: 0;
}

/* Tooltip */
.premium-mobile-chart-wrapper .premium-chart-tooltip {
    position: absolute;
    padding: 8px 10px;
    background: rgba(15, 20, 32, 0.92);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 8px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 10;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.premium-mobile-chart-wrapper .premium-chart-tooltip .tooltip-date {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2px;
}

.premium-mobile-chart-wrapper .premium-chart-tooltip .tooltip-price {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #22c55e;
}

.premium-mobile-chart-wrapper .premium-chart-tooltip .tooltip-metrics {
    margin-top: 4px;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.65);
}

/* ---------------------------------------------------------------------------
   Mini navigator (zoom range)
   --------------------------------------------------------------------------- */
.premium-mobile-chart-wrapper .premium-mini-navigator {
    margin-top: 8px;
    padding: 0 4px;
}

.premium-mobile-chart-wrapper .navigator-track {
    position: relative;
    height: 28px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    overflow: hidden;
}

.premium-mobile-chart-wrapper .navigator-canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 6px;
}

.premium-mobile-chart-wrapper .navigator-selection {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 4px;
    pointer-events: none;
}

.premium-mobile-chart-wrapper .navigator-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 12px;
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.premium-mobile-chart-wrapper .handle-grip {
    width: 4px;
    height: 14px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
}

.premium-mobile-chart-wrapper .navigator-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ---------------------------------------------------------------------------
   Bottom controls: legend + filter buttons (desktop-style, compact)
   --------------------------------------------------------------------------- */
.premium-mobile-chart-wrapper .mobile-chart-bottom-controls {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.premium-mobile-chart-wrapper .mobile-chart-bottom-controls .chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
    justify-content: flex-end;
}

.premium-mobile-chart-wrapper .mobile-chart-bottom-controls .chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.premium-mobile-chart-wrapper .mobile-chart-bottom-controls .chart-legend-dash {
    width: 14px;
    height: 2px;
    flex-shrink: 0;
}

.premium-mobile-chart-wrapper .mobile-chart-bottom-controls .chart-legend-dash.chart-legend-price {
    background: #22c55e;
}

.premium-mobile-chart-wrapper .mobile-chart-bottom-controls .chart-legend-dash.chart-legend-yield {
    background: #3b82f6;
}

.premium-mobile-chart-wrapper .mobile-chart-bottom-controls .chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.premium-mobile-chart-wrapper .mobile-chart-bottom-controls .chart-legend-dot.chart-legend-payment {
    background: rgba(251, 146, 60, 0.9);
}

.premium-mobile-chart-wrapper .mobile-chart-bottom-controls .chart-legend-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Filter buttons – touch-friendly */
.premium-mobile-chart-wrapper .chart-filter-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.premium-mobile-chart-wrapper .mobile-chart-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.premium-mobile-chart-wrapper .mobile-chart-filter-btn:hover {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(102, 179, 255, 0.35);
}

.premium-mobile-chart-wrapper .mobile-chart-filter-btn.active {
    color: #66b3ff;
    background: rgba(102, 179, 255, 0.12);
    border-color: rgba(102, 179, 255, 0.45);
}

.premium-mobile-chart-wrapper .mobile-chart-filter-btn i {
    font-size: 0.8125rem;
}
