/* SIP Calculator Styles - Matching Vrid Theme */

.calculator-section {
    position: relative;
    padding: 140px 0 80px;
    min-height: 100vh;
}

.calculator-header {
    text-align: center;
    margin-bottom: 50px;
}

.calculator-header h1 {
    font-size: 56px;
    font-family: "Raleway", sans-serif;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
}

.calculator-header .subtitle {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0;
}

/* Calculator Wrapper */
.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    background: linear-gradient(145deg, #2F3142 0%, #252736 100%);
    border-radius: 24px;
    padding: 50px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1100px;
    margin: 0 auto;
}

/* Input Groups */
.input-group-custom {
    margin-bottom: 40px;
}

.input-group-custom:last-child {
    margin-bottom: 0;
}

.input-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.input-label-row label {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.input-value-display {
    display: flex;
    align-items: center;
    background: rgba(255, 213, 0, 0.1);
    border: 1px solid rgba(255, 213, 0, 0.3);
    border-radius: 8px;
    padding: 8px 14px;
}

.input-value-display .currency,
.input-value-display .unit {
    color: #FFD500;
    font-weight: 600;
    font-size: 15px;
}

.inline-input {
    background: transparent;
    border: none;
    color: #FFD500;
    font-weight: 700;
    font-size: 18px;
    width: 120px;
    text-align: right;
    font-family: "Source Sans Pro", sans-serif;
}

.inline-input:focus {
    outline: none;
}

.duration-input {
    width: 40px;
}

.rate-input {
    width: 40px;
}

/* Custom Slider */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #FFD500 0%, #9a20bc 100%);
    outline: none;
    margin: 0;
}

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

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 16px rgba(255, 213, 0, 0.4);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 3px solid #FFD500;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Preset Chips */
.preset-chips {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.chip {
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: "Source Sans Pro", sans-serif;
}

.chip:hover {
    background: rgba(255, 213, 0, 0.15);
    border-color: rgba(255, 213, 0, 0.4);
    color: #FFD500;
}

.chip.active {
    background: linear-gradient(135deg, rgba(255, 213, 0, 0.2) 0%, rgba(154, 32, 188, 0.2) 100%);
    border-color: #FFD500;
    color: #FFD500;
}

/* Results Section */
.calculator-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Donut Chart */
.donut-chart-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin-bottom: 30px;
}

.donut-chart {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut-ring {
    transition: stroke 0.3s ease;
}

.donut-segment {
    transition: stroke-dasharray 0.6s ease-out, stroke-dashoffset 0.6s ease-out;
}

.donut-segment.invested {
    stroke: #FFD500;
}

.donut-segment.returns {
    stroke: #9a20bc;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-label {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}

.donut-value {
    display: block;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    font-family: "Raleway", sans-serif;
}

/* Result Breakdown */
.result-breakdown {
    width: 100%;
    max-width: 280px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.breakdown-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 14px;
    flex-shrink: 0;
}

.breakdown-indicator.invested {
    background: #FFD500;
}

.breakdown-indicator.returns {
    background: #9a20bc;
}

.breakdown-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.breakdown-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2px;
}

.breakdown-value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    font-family: "Raleway", sans-serif;
}

/* CTA Section */
.cta-section {
    margin-top: 30px;
    text-align: center;
}

.cta-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 15px;
}

.download-btn {
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.download-btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.download-btn img {
    height: 48px;
}

/* Info Section */
.info-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 60px;
}

.info-card {
    background: rgba(47, 49, 66, 0.6);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 213, 0, 0.3);
}

.info-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 213, 0, 0.15) 0%, rgba(154, 32, 188, 0.15) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.info-icon i {
    font-size: 28px;
    color: #FFD500;
}

.info-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
    font-family: "Raleway", sans-serif;
}

.info-card p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 0;
    line-height: 1.6;
}

/* Advanced Options */
.advanced-options {
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.advanced-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    padding: 12px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.advanced-toggle:hover .toggle-text {
    color: #FFD500;
}

.toggle-text {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.toggle-icon {
    color: rgba(255, 255, 255, 0.5);
    font-size: 24px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.advanced-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
    color: #FFD500;
}

.advanced-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

.advanced-content.show {
    max-height: 400px;
    opacity: 1;
}

.advanced-option {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.advanced-option:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.option-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.option-info {
    flex: 1;
}

.option-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 3px;
}

.option-hint {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: 0.3s;
    border-radius: 24px;
}

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

.toggle-switch input:checked+.toggle-slider {
    background: linear-gradient(135deg, #FFD500 0%, #9a20bc 100%);
}

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

.option-input-row {
    display: flex;
    align-items: center;
    gap: 16px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.option-input-row.enabled {
    opacity: 1;
    pointer-events: auto;
}

.slider-small {
    flex: 1;
    height: 6px;
}

/* Lumpsum Section (Standalone) */
.lumpsum-section {
    margin-top: 30px;
    margin-bottom: 30px;
    background: rgba(255, 213, 0, 0.05);
    border: 1px dashed rgba(255, 213, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
}

.lumpsum-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lumpsum-toggle:hover {
    background: rgba(255, 213, 0, 0.08);
}

.lumpsum-toggle-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lumpsum-icon {
    color: #FFD500;
    font-size: 22px;
}

.lumpsum-toggle-text {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.lumpsum-toggle .toggle-icon {
    color: #FFD500;
    font-size: 22px;
    transition: transform 0.3s ease;
}

.lumpsum-toggle.expanded .toggle-icon {
    transform: rotate(45deg);
}

.lumpsum-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 20px;
}

.lumpsum-content.show {
    max-height: 250px;
    padding: 0 20px 20px;
}

.lumpsum-input-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.lumpsum-amount-display {
    flex-shrink: 0;
}

.lumpsum-amount-display .inline-input {
    width: 100px;
}

.lumpsum-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.input-value-display.small {
    padding: 6px 10px;
}

.input-value-display.small .inline-input {
    font-size: 14px;
    width: 30px;
}

.input-value-display.small .unit {
    font-size: 13px;
}

/* Inflation indicator */
.breakdown-indicator.inflation {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
}

.inflation-adjusted {
    background: rgba(76, 175, 80, 0.08);
    border-radius: 8px;
    margin-top: 8px;
    padding: 16px !important;
}

/* Tax Result Styles */
.breakdown-indicator.tax {
    background: linear-gradient(135deg, #FF5252 0%, #D32F2F 100%);
}

.breakdown-indicator.post-tax {
    background: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
}

.tax-result {
    background: rgba(255, 82, 82, 0.08);
    border-radius: 8px;
    margin-top: 8px;
    padding: 16px !important;
}

.tax-amount {
    color: #FF5252 !important;
}

.post-tax-result {
    background: rgba(33, 150, 243, 0.08);
    border-radius: 8px;
    margin-top: 8px;
    padding: 16px !important;
}

/* Yearly Breakdown Section */
.yearly-breakdown-section {
    margin-top: 60px;
    background: linear-gradient(145deg, #2F3142 0%, #252736 100%);
    border-radius: 24px;
    padding: 40px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.breakdown-header {
    text-align: center;
    margin-bottom: 40px;
}

.breakdown-header h2 {
    font-size: 32px;
    font-family: "Raleway", sans-serif;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.breakdown-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0;
}

/* Milestones */
.milestones-container {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.milestone-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.milestone-badge.achieved {
    background: linear-gradient(135deg, rgba(255, 213, 0, 0.15) 0%, rgba(154, 32, 188, 0.15) 100%);
    border-color: #FFD500;
}

.milestone-badge.achieved .milestone-icon {
    color: #FFD500;
}

.milestone-icon {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.4);
}

.milestone-info {
    display: flex;
    flex-direction: column;
}

.milestone-amount {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.milestone-year {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.milestone-badge.achieved .milestone-year {
    color: #FFD500;
}

/* Chart Container */
.chart-container {
    margin-bottom: 30px;
}

.chart-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 30px 20px 20px;
    margin-bottom: 16px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 200px;
    gap: 8px;
    padding: 0 10px;
}

.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 60px;
    position: relative;
}

.bar-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 6px 6px 0 0;
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
}

.bar-stack:hover {
    transform: scaleY(1.02);
    filter: brightness(1.1);
}

.bar-invested {
    background: #FFD500;
    width: 100%;
}

.bar-returns {
    background: #9a20bc;
    width: 100%;
}

.bar-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chart-bar:hover .bar-value {
    opacity: 1;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    padding: 12px 10px 0;
    gap: 8px;
}

.chart-label {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    max-width: 60px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.legend-color.invested {
    background: #FFD500;
}

.legend-color.returns {
    background: #9a20bc;
}

.legend-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

/* Yearly Table */
.yearly-table-container {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.table-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.table-toggle:hover {
    color: #FFD500;
}

.table-toggle i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.table-toggle.expanded i {
    transform: rotate(180deg);
}

.yearly-table-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.yearly-table-wrapper.show {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
}

.yearly-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.yearly-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.yearly-table tbody tr {
    transition: background 0.2s ease;
}

.yearly-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.yearly-table tbody tr.milestone-row {
    background: rgba(255, 213, 0, 0.05);
}

.yearly-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.yearly-table tbody td:first-child {
    font-weight: 600;
}

.growth-positive {
    color: #4CAF50;
}

.milestone-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 2px 8px;
    background: rgba(255, 213, 0, 0.15);
    border-radius: 4px;
    font-size: 11px;
    color: #FFD500;
}

.milestone-indicator i {
    font-size: 12px;
}

.inflation-cell {
    color: #4CAF50;
    font-style: italic;
}


/* Responsive Design */
@media (max-width: 992px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 35px;
    }

    /* Mobile divider between inputs and results */
    .calculator-results {
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        padding-top: 40px;
    }

    .calculator-header h1 {
        font-size: 42px;
    }

    .info-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .calculator-section {
        padding: 120px 0 60px;
    }

    .calculator-header h1 {
        font-size: 32px;
    }

    .calculator-header .subtitle {
        font-size: 16px;
    }

    .calculator-wrapper {
        padding: 25px;
        border-radius: 18px;
    }

    .donut-chart-container {
        width: 180px;
        height: 180px;
    }

    .donut-value {
        font-size: 22px;
    }

    .preset-chips {
        gap: 8px;
    }

    .chip {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Lumpsum section mobile fixes */
    .lumpsum-content.show {
        max-height: 280px;
    }

    .lumpsum-content .input-value-display {
        width: 100%;
        justify-content: flex-start;
    }

    .lumpsum-content .inline-input {
        width: 100%;
        text-align: left;
    }

    /* Table horizontal scroll for mobile */
    .yearly-table-wrapper.show {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .yearly-table {
        min-width: 500px;
    }
}

@media (max-width: 480px) {
    .calculator-header h1 {
        font-size: 28px;
    }

    .input-label-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .inline-input {
        font-size: 16px;
    }

    .breakdown-value {
        font-size: 18px;
    }
}