/**
 * TrendSpider Market Volume Chart Styles
 * Dark blue visual system — matches Technical Analysis and Trading View pages
 *
 * @package ContrarianTraderMember
 */

/* =====================================================================
   Main Container
   ===================================================================== */
.tctm-volume-chart-container {
    background: linear-gradient(180deg, #123C6B 0%, #1E64B7 100%);
    border-radius: 18px;
    padding: 0;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 20px;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
}

/* =====================================================================
   Symbol Header
   ===================================================================== */
.tctm-volume-chart-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 18px 22px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.12);
}

.tctm-volume-chart-symbol {
    font-size: 22px;
    font-weight: 800;
    color: #5EA6FF;
    letter-spacing: 0.5px;
    line-height: 1;
}

.tctm-volume-chart-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: #AFC6E8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =====================================================================
   iframe Wrapper
   ===================================================================== */
#volumeIframe_,
[id^="volumeIframe_"] {
    width: 100%;
    display: block;
    position: relative; /* required for gate overlay */
}

[id^="volumeIframe_"] iframe {
    display: block;
    border: none;
    width: 100%;
}

/* =====================================================================
   Transparent Chart Click Layer
   Blocks iframe same-tab redirect and opens
   the appropriate TrendSpider chart in a new tab.
   No blur, no overlay UI, no gate.
   ===================================================================== */
.tctm-volume-chart-container .tctm-chart-click-layer {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: pointer;
    background: transparent;
    display: block;
    text-decoration: none;
}

/* Microcopy + Secondary CTA — bottom-right of chart container */
.tctm-volume-chart-container .tctm-chart-microcopy-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    padding: 10px 18px 14px;
}

.tctm-volume-chart-container .tctm-chart-microcopy {
    font-size: 12px;
    color: rgba(175, 198, 232, 0.55);
    font-weight: 400;
}

.tctm-volume-chart-container .tctm-chart-secondary-cta {
    font-size: 13px;
    color: #5EA6FF;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.tctm-volume-chart-container .tctm-chart-secondary-cta:hover {
    color: #7CB8FF;
    text-decoration: underline;
}

/* =====================================================================
   Attribution Footer
   Reuses .tctm-chart-copyright defined here so the shortcode is
   self-contained (trading-view.css is conditionally loaded).
   ===================================================================== */
.tctm-volume-chart-container .tctm-chart-copyright {
    padding: 10px 18px;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    color: #AFC6E8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tctm-volume-chart-container .tctm-chart-copyright a {
    color: #5EA6FF;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.tctm-volume-chart-container .tctm-chart-copyright a:hover {
    color: #7CB8FF;
    text-decoration: underline;
}

.tctm-volume-chart-container .tctm-chart-copyright-sep {
    color: rgba(175, 198, 232, 0.4);
    font-size: 11px;
}

.tctm-volume-chart-container .tctm-chart-powered {
    flex-basis: 100%;
    text-align: center;
    font-size: 11px;
    color: rgba(175, 198, 232, 0.5);
    margin-top: 2px;
}

/* =====================================================================
   Loading State — CSS spinner (no visible <p> text)
   ===================================================================== */
.tctm-volume-chart-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 450px;
    background: rgba(255, 255, 255, 0.04);
}

.tctm-volume-chart-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: #5EA6FF;
    border-radius: 50%;
    animation: tctm-vol-spin 1s linear infinite;
}

@keyframes tctm-vol-spin {
    to { transform: rotate(360deg); }
}

/* =====================================================================
   Error State
   ===================================================================== */
.tctm-volume-chart-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #EAF2FF;
    padding: 20px;
    border-radius: 18px;
    text-align: center;
    margin: 20px 0;
}

.tctm-volume-chart-error p {
    margin: 0;
    font-size: 15px;
}

/* =====================================================================
   Responsive — 768px
   ===================================================================== */
@media screen and (max-width: 768px) {
    .tctm-volume-chart-container {
        border-radius: 12px;
    }

    .tctm-volume-chart-loading {
        min-height: 400px;
    }

    .tctm-volume-chart-header {
        padding: 14px 16px 12px;
    }

    .tctm-volume-chart-symbol {
        font-size: 18px;
    }

    [id^="volumeIframe_"] iframe {
        height: 400px;
    }
}

/* =====================================================================
   Responsive — 480px
   ===================================================================== */
@media screen and (max-width: 480px) {
    .tctm-volume-chart-container {
        margin-bottom: 15px;
    }

    .tctm-volume-chart-loading {
        min-height: 350px;
    }

    .tctm-volume-chart-header {
        flex-direction: column;
        gap: 4px;
        padding: 12px 14px 10px;
    }

    .tctm-volume-chart-symbol {
        font-size: 16px;
    }

    [id^="volumeIframe_"] iframe {
        height: 350px;
    }
}
