/* Historical Inflation Calculator - Simplified Styles */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Ensure body wrapper doesn't constrain width */
.hic-body {
    width: 100%;
    box-sizing: border-box;
}

/* CMS width overrides - multiple selectors for compatibility */
.c-matter--article .c-matter__body:has(.ci-body) {
    max-width: 1170px !important;
    width: auto !important;
}

.c-matter--article .c-matter__body:has(.hic-body) {
    max-width: 1170px !important;
    width: auto !important;
}

/* Fallback for browsers without :has() support */
.c-matter--article .c-matter__body {
    max-width: 1170px;
}

/* Container */
.hic-calculator-container {
    max-width: 1170px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.hic-calculator-intro {
    line-height: 1.6;
    opacity: 0.85;
    margin-bottom: 2rem;
}

/* Layout */
.hic-calculator-main {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 3rem !important;
    align-items: start !important;
    width: 100% !important;
}

.hic-form-section,
.hic-results-section {
    min-width: 0 !important;
    max-width: 100% !important;
}

/* Form */
.hic-form-section {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
}

.hic-form-section input, textarea {
    margin-bottom: 25px;
}

.hic-form-group {
    margin-bottom: 1.5rem;
}

.hic-form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Inputs */
input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

input[type="text"].hic-error {
    border-color: #d32f2f;
}

/* Slider */
.hic-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.hic-slider-header label { margin-bottom: 0; }

.hic-value-display {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    min-width: 100px;
    text-align: center;
    width: 40%!important;
}

#hic-startingAmountDisplay {
    margin: 0;
}

.hic-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 15px 0;
}

.hic-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0066cc;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid #fff;
    margin-top: -7px;
}

.hic-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0066cc;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hic-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, #0066cc 0%, #0066cc var(--slider-progress, 0%), #e0e0e0 var(--slider-progress, 0%));
    border-radius: 3px;
}

.hic-slider::-moz-range-track {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
}

.hic-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    margin-bottom: 25px;
    color: #666;
    font-size: 0.875rem;
}

/* Tooltips */
.hic-tooltip {
    display: inline-block;
    margin-left: 6px;
    width: 18px;
    height: 18px;
    background: #64748b;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    cursor: help;
    position: relative;
    line-height: 18px;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.hic-tooltip:hover {
    background: #475569;
    transform: scale(1.1);
}

.hic-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 400;
    white-space: normal;
    width: 280px;
    text-align: left;
    z-index: 10000;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    line-height: 1.5;
}

.hic-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    z-index: 10001;
}

/* Errors */
.hic-error-message {
    color: #d32f2f;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    min-height: 1.25rem;
}

.hic-error-message:empty { display: none; }

/* Results */
.hic-results-section {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.hic-results-section h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 500;
}

.hic-primary-value {
    font-size: 3rem;
    font-weight: bold;
    color: #0066cc;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hic-result-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #0066cc;
    margin-bottom: 1.5rem;
}

.hic-result-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hic-result-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

/* Chart */
.hic-chart-container { margin-bottom: 2rem; }

.hic-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.hic-toggle-chart {
    background: none;
    border: none;
    color: #0066cc;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 0.875rem;
    text-decoration: underline;
}

.hic-chart-wrapper {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 6px;
    min-height: 250px;
    margin-bottom: 1rem;
}

.hic-chart-wrapper.hidden { display: none; }

.hic-chart-wrapper canvas {
    max-width: 100%;
}

/* Note */
p.hic-results-note,
.hic-results-note {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    margin: 1.5rem 0;
    line-height: 1.6;
    color: #92400e;
    font-size: 0.9rem;
    font-style: italic;
}

/* Buttons */
.hic-action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.hic-action-buttons button,
.hic-action-buttons .c-btn {
    flex: 1;
}

/* Responsive - Tablet */
@media (max-width: 968px) {
    .hic-calculator-main { 
        grid-template-columns: 1fr !important; 
        gap: 2rem !important; 
    }
    .hic-calculator-container { padding: 1.5rem; }
    .hic-form-section, .hic-results-section { padding: 1.5rem; }
}

/* Responsive - Mobile */
@media (max-width: 640px) {
    .hic-calculator-container { padding: 1rem; }
    .hic-form-section, .hic-results-section { padding: 1.25rem; }
    .hic-primary-value { font-size: 2.25rem; }
    .hic-action-buttons { flex-direction: column; }
    .hic-value-display { width: 45% !important; }
    .hic-calculator-intro { font-size: 0.95rem; }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
    .hic-slider-header { flex-wrap: wrap; gap: 8px; }
    .hic-slider-header label { width: 100%; }
    .hic-value-display { width: 100% !important; }
    .hic-primary-value { font-size: 2rem; }
    .hic-result-card { padding: 0.75rem; }
}
