/* Student loan calculator styles. Extracted from page-level CSS so every page can reuse the widget. */
:root {
    --primary-blue: #2563eb;
    /* Vibrant Blue */
    --primary-hover: #1d4ed8;
    --bg-color: #f3f4f6;
    /* Light Grey Background */
    --card-bg: #ffffff;
    --text-main: #1f2937;
    /* Dark Grey/Black */
    --text-muted: #6b7280;
    --border-color: #e5e7eb;

    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.slc-calculator,
.slc-calculator *,
.slc-calculator *::before,
.slc-calculator *::after,
#slc-tooltip,
#slc-tooltip * {
    box-sizing: border-box;
}

.slc-calculator {
    font-family: var(--font-family);
    color: var(--text-main);
    line-height: 1.5;
}

#slc-tooltip {
    font-family: var(--font-family);
}

/* Calculator Card Container */
.slc-calculator {
    background: var(--card-bg);
    max-width: 1000px;
    margin: 0 auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
}

.slc-calculator__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 900px) {
    .slc-calculator__grid {
        grid-template-columns: 350px 1fr;
    }
}

/* Controls */
.slc-calculator__controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.slc-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slc-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.slc-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Inputs */
.slc-number-input,
.slc-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    color: #1f2937 !important;
    /* Force visibility against theme overrides */
    background-color: #ffffff !important;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: auto;
    /* Ensure OS dropdown arrow is visible */
    -webkit-appearance: auto;
    -moz-appearance: auto;
    height: auto !important;
    /* Prevent theme from forcing a fixed height that clips text */
    line-height: 1.5 !important;
    /* Ensure text is vertically centered */
    min-height: 45px;
    /* Ensure sufficient touch target */
}

.slc-number-input:focus,
.slc-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Checkboxes */
.slc-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #f9fafb;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.slc-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.slc-checkbox input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary-blue);
    border-radius: 4px;
}

/* Toggle Switch (New) */
.slc-toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

.slc-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.slc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slc-slider-round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: .3s;
    border-radius: 24px;
}

.slc-slider-round:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

input:checked+.slc-slider-round {
    background-color: var(--primary-blue);
}

input:focus+.slc-slider-round {
    box-shadow: 0 0 1px var(--primary-blue);
}

input:checked+.slc-slider-round:before {
    transform: translateX(20px);
}

/* Sliders */
.slc-range {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slc-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-blue);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Accordion (Advanced Options) */
.slc-accordion__toggle {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    width: 100%;
    text-align: left;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    transition: background 0.2s;
}

.slc-accordion__toggle:hover {
    background: #f9fafb;
}

.slc-accordion__content {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Power Tool (Invest vs Repay) */
.slc-power-tool {
    background: #eff6ff;
    /* Light blue tint */
    border: 1px solid #bfdbfe;
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-top: 1rem;
}

.slc-power-tool__title {
    color: var(--primary-blue);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Metrics Grid / Results */
.slc-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.slc-metric-card {
    background: white;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.slc-metric-card__label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.slc-metric-card__value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
}

/* Chart Container */
.slc-chart-container {
    height: 400px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
}

/* Info Icon */
.slc-info-trigger {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.slc-info-trigger:hover {
    color: var(--primary-blue);
}

/* Tooltip */
.slc-tooltip {
    background: #1f2937;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    max-width: 300px;
    line-height: 1.4;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 9999;
}

.slc-tooltip strong {
    color: #93c5fd;
    /* Light blue text for headers in tooltip */
    display: block;
    margin-bottom: 0.25rem;
}

/* Value Display (sliders) */
.slc-value-display {
    font-weight: 600;
    color: var(--primary-blue);
}

/* Helper Utilities */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Sub-metric (Yearly Repayment) */
.slc-sub-metric {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Warning Bar */
.slc-warning-bar {
    background-color: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    /* Align icon to top of text block */
    gap: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    line-height: 1.5;
}

.slc-warning-icon {
    font-size: 1.2rem;
    line-height: 1;
    margin-top: 2px;
    /* Visual adjustment */
    flex-shrink: 0;
}

.slc-warning-text {
    flex: 1;
}

/* Detailed Stats Grid */
.slc-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.slc-detail-card {
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.slc-detail-title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.slc-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.slc-detail-row:last-child {
    margin-bottom: 0;
}

.slc-detail-row span:first-child {
    color: var(--text-muted);
}

.slc-detail-value {
    font-weight: 600;
    color: var(--text-main);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

    .slc-calculator {
        padding: 1.5rem;
    }

    .slc-metrics-grid,
    .slc-details-grid {
        grid-template-columns: 1fr;
        /* Force single column to avoid squishing */
    }
}
