/* volatilitycalc.css - VolatilityCalc page styles */

/* Main container */
.volatility-main-container {
    margin: 0 auto;
    padding: 0.75rem;
    max-width: 100%;
}

/* Page header */
.volatility-header {
    margin-bottom: 1rem;
    padding-bottom: 0.25rem;
}

.volatility-header h5 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a3154;
    margin-bottom: 0.15rem;
    letter-spacing: -0.3px;
}

.volatility-header .subtitle {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 400;
    margin-bottom: 0;
}

/* Chart container */
.volatility-chart-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(26, 49, 84, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.03);
    padding: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
    overflow: hidden;
}

#chart_div {
    width: 100%;
    min-height: 350px;
    overflow: hidden;
}

.chart-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    background: linear-gradient(135deg, #f5f7fa 0%, #f0f3f7 100%);
    border-radius: 8px;
}

/* Card styling */
.volatility-input-card,
.volatility-metrics-card {
    height: 100%;
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 2px 12px rgba(26, 49, 84, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    overflow: hidden;
    background: #ffffff !important;
}

.volatility-input-card:hover,
.volatility-metrics-card:hover {
    box-shadow: 0 6px 20px rgba(26, 49, 84, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

.volatility-input-card > .card-header,
.volatility-metrics-card > .card-header {
    background: linear-gradient(135deg, #2c4a7c 0%, #1a3154 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.25rem;
    letter-spacing: 0.3px;
    border-bottom: none;
    text-align: center;
}

.volatility-input-card > .card-body,
.volatility-metrics-card > .card-body {
    padding: 1.25rem;
    background: #ffffff;
}

.volatility-input-card > .card-footer,
.volatility-metrics-card > .card-footer {
    background: #fafbfc;
    border-top: 1px solid #eef1f5;
    padding: 0.75rem 1.25rem;
}

/* Input and metric rows */
.volatility-input-row,
.metric-input-row {
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.1rem;
    border-radius: 6px;
    transition: background-color 0.15s ease;
}

.volatility-input-row:hover,
.metric-input-row:hover {
    background-color: rgba(32, 68, 104, 0.025);
}

/* Labels */
.volacalc-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0;
    line-height: 2.2;
    white-space: nowrap;
}

/* Form controls */
.volacalc-control {
    font-size: 0.85rem;
    padding: 0.4rem 0.65rem;
    border-radius: 8px !important;
    border: 1.5px solid #dee2e6;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #fff;
    width: 100%;
}

.volacalc-control:focus {
    border-color: #2c4a7c;
    box-shadow: 0 0 0 3px rgba(44, 74, 124, 0.12);
    outline: none;
}

.volacalc-control:hover:not(:focus):not([readonly]):not(:disabled) {
    border-color: #adb5bd;
}

.volacalc-control[readonly] {
    background-color: #f8f9fa;
    border-color: #e9ecef;
    color: #495057;
    cursor: default;
}

.volacalc-control:disabled {
    background-color: #f0f2f5;
    border-color: #e0e3e7;
    color: #8c939d;
    cursor: not-allowed;
}

/* Button section */
.volatility-input-card .button-section {
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid #eef1f5;
}

/* Calculator form */
#CalculatorForm {
    width: 100%;
}

/* Subscription message */
.subscription-message {
    font-size: 0.875rem;
    font-weight: 400;
    color: #495057;
    margin: 0;
}

/* Methodology / documentation section */
.methodology-section {
    margin-top: 2.5rem;
    padding: 2rem 0 0;
    border-top: 1px solid #e9ecef;
}

.methodology-section h4 {
    color: #1a3154;
    font-weight: 700;
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
}

/* Accordion styles */
.methodology-section .accordion-item {
    border: 1px solid #e9ecef;
    border-radius: 8px !important;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

.methodology-section .accordion-button {
    font-weight: 600;
    color: #2c4a7c;
    background-color: #f8f9fa;
    padding: 1rem 1.25rem;
}

.methodology-section .accordion-button:not(.collapsed) {
    color: #1a3154;
    background-color: #e8f0fe;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.125);
}

.methodology-section .accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(32, 68, 104, 0.25);
    border-color: #204468;
}

.methodology-section .accordion-body {
    color: #495057;
    line-height: 1.7;
    padding: 1.25rem;
    background-color: #ffffff;
}

.methodology-section .accordion-body strong {
    color: #204468;
}

/* Documentation body — consistent vertical rhythm */
.methodology-body {
    max-width: 70ch;
}

.methodology-body h6 {
    color: #1a3154;
    font-weight: 700;
    font-size: 0.95rem;
    margin: 1.5rem 0 0.5rem;
}

.methodology-body h6:first-child {
    margin-top: 0;
}

.methodology-body p {
    margin-bottom: 0.875rem;
}

.methodology-body p:last-child {
    margin-bottom: 0;
}

.methodology-body blockquote {
    border-left: 3px solid #2c4a7c;
    margin: 0.75rem 0 0;
    padding: 0.75rem 1rem;
    background: rgba(32, 68, 104, 0.03);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: #495057;
    line-height: 1.65;
}

/* Definition list — Inputs & Glossary */
.methodology-dl {
    margin: 0;
}

.methodology-dl dt {
    color: #204468;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
}

.methodology-dl dt:first-child {
    margin-top: 0;
}

.methodology-dl dd {
    margin-left: 0;
    margin-bottom: 0;
    padding-left: 1rem;
    border-left: 2px solid #e9ecef;
    line-height: 1.65;
}

/* ---- Responsive ---- */

/* Extra large screens */
@media (min-width: 1200px) {
    #chart_div {
        min-height: 420px;
    }
}

/* Medium screens and below */
@media (max-width: 991px) {
    #chart_div {
        min-height: 280px;
    }
}

/* Small tablets / large phones */
@media (max-width: 768px) {
    .volatility-main-container {
        padding: 0.4rem;
    }

    .volatility-chart-container {
        padding: 0.6rem;
        margin-bottom: .81rem;
    }

    #chart_div {
        min-height: 240px;
    }

    .volatility-header h5 {
        font-size: 1.25rem;
    }

    .volatility-input-row .row,
    .metric-input-row .row {
        flex-direction: column;
    }

    .volatility-input-row .row > [class*="col-"],
    .metric-input-row .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .volacalc-label {
        margin-bottom: 0.2rem;
    }

    .volatility-input-card > .card-body,
    .volatility-metrics-card > .card-body {
        padding: 0.875rem;
    }
}

/* Phones */
@media (max-width: 576px) {
    #chart_div {
        min-height: 200px;
    }

    .volatility-input-card > .card-body,
    .volatility-metrics-card > .card-body {
        padding: 0.5rem;
    }

    .volacalc-label {
        font-size: 0.8rem;
    }

    .volacalc-control {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
    }
}
