/* Save a Million Dollars Calculator Styles */
/* Prefix: smd- */

/* Reset and base styles - inherit from host site */
.smd-body {
    line-height: 1.6;
    color: #333;
}

.smd-body *,
.smd-body *::before,
.smd-body *::after {
    box-sizing: border-box;
}

/* Container */
.smd-container {
    max-width: 1150px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    overflow: visible;
}

/* Override CMS article width constraints */
.c-matter--article .smd-container {
    max-width: 1150px !important;
    width: 100% !important;
}

/* Header */
.smd-header {
    text-align: center;
    margin-bottom: 32px;
}

.smd-header p {
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    font-size: 1rem;
}

/* Calculator Layout - Two Column Grid */
.smd-calculator-layout {
    display: grid;
    grid-template-columns: 0.48fr 0.52fr;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    align-items: start;
}

.c-matter--article .smd-calculator-layout {
    display: grid;
    grid-template-columns: 0.48fr 0.52fr;
    gap: 24px;
}

/* Form Column */
.smd-form-column {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 26px;
    transform: translateZ(0);
    will-change: transform;
}

@media (min-width: 751px) {
    .smd-form-column {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 20px !important;
        align-self: start !important;
        height: fit-content;
    }
}

.smd-form-column h2 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 1.3rem;
    color: #1e293b;
}

/* Input Groups */
.smd-input-section {
    margin-bottom: 20px;
}

.smd-input-group {
    margin-bottom: 20px;
}

.smd-input-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 0.95rem;
}

/* Input Wrapper */
.smd-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.smd-input-wrapper input {
    width: 100%;
    padding: 12px 16px;
    padding-left: 28px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.smd-input-wrapper input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.smd-input-wrapper input::placeholder {
    color: #9ca3af;
    opacity: 0.6;
}

/* No currency symbol - left padding normal */
.smd-input-wrapper.smd-no-currency input {
    padding-left: 16px;
}

/* Currency Symbol */
.smd-currency {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-weight: 500;
    pointer-events: none;
    z-index: 1;
}

/* Unit Symbol (%, years) */
.smd-unit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-weight: 500;
    pointer-events: none;
    z-index: 1;
}

.smd-input-wrapper:has(.smd-unit) input {
    padding-right: 55px;
}

.smd-input-wrapper:has(.smd-unit.smd-unit-short) input {
    padding-right: 35px;
}

.smd-unit-short {
    right: 12px;
}

/* Hide steppers by default */
.smd-input-wrapper input::-webkit-outer-spin-button,
.smd-input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.smd-input-wrapper input[type="number"] {
    -moz-appearance: textfield;
}

/* Slider Styles */
.smd-has-slider {
    margin-bottom: 24px;
}

.smd-slider-wrapper {
    margin-top: 8px;
}

.smd-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.smd-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.smd-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

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

.smd-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #64748b;
}

/* Tooltip */
.smd-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.smd-tooltip:hover {
    background: #3b82f6;
    color: #fff;
}

.smd-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 400;
    white-space: normal;
    width: 220px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
    line-height: 1.4;
}

.smd-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
}

.smd-tooltip.active::after,
.smd-tooltip.active::before {
    opacity: 1;
    visibility: visible;
}

/* Goal Display */
.smd-goal-display {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fcd34d;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.smd-goal-display h3 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: #92400e;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.smd-goal-display .smd-goal-amount {
    font-size: 2rem;
    font-weight: 700;
    color: #78350f;
}

/* Disclaimer */
.smd-disclaimer-text {
    margin-top: 24px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f3f3f3;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
}

/* Download Section */
.smd-download-section {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

.smd-download-section button {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.smd-start-over-btn {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
}

.smd-start-over-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.smd-download-btn {
    background: #3b82f6;
    border: 1px solid #3b82f6;
    color: #fff;
}

.smd-download-btn:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* Results Column */
.smd-results-column {
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

/* Main Result Card */
.smd-main-result {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    border-radius: 12px;
    padding: 32px 26px;
    margin-bottom: 24px;
    text-align: center;
}

.smd-main-result h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: #065f46;
    font-weight: 500;
}

.smd-main-value {
    font-size: 3.5rem;
    font-weight: 700;
    color: #047857;
    margin-bottom: 8px;
    line-height: 1.1;
}

.smd-main-result .smd-per-month {
    font-size: 1.1rem;
    color: #065f46;
    font-weight: 500;
}

.smd-explanation-text {
    font-size: 0.95rem;
    color: #047857;
    margin: 16px 0 0 0;
    line-height: 1.5;
}

.smd-explanation-text span {
    font-weight: 600;
}

/* Breakdown Card */
.smd-breakdown {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 26px;
    margin-bottom: 24px;
}

.smd-breakdown h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.1rem;
    color: #1e293b;
}

.smd-breakdown-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.smd-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.smd-breakdown-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.smd-breakdown-label {
    color: #64748b;
    font-size: 0.95rem;
}

.smd-breakdown-value {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

.smd-breakdown-value.smd-highlight {
    color: #047857;
}

/* Interpretation */
.smd-interpretation {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.smd-interpretation h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1rem;
    color: #0369a1;
}

.smd-interpretation p {
    margin: 0;
    color: #0c4a6e;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Mobile Buttons */
.smd-button-mobile {
    display: none;
    gap: 12px;
    margin-top: 24px;
}

.smd-button-mobile button {
    flex: 1;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 750px) {
    .smd-calculator-layout,
    .c-matter--article .smd-calculator-layout {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .smd-form-column {
        position: static !important;
    }
    
    .smd-results-column {
        min-height: 0 !important;
    }
    
    .smd-container {
        padding: 0 16px;
    }
    
    .smd-main-value {
        font-size: 2.5rem;
    }
    
    .smd-download-section {
        display: none;
    }
    
    .smd-button-mobile {
        display: flex;
        flex-direction: column;
    }
    
    .smd-goal-display .smd-goal-amount {
        font-size: 1.5rem;
    }
}

