/* ===== SIP CALCULATOR — Tool Specific CSS ===== */

/* ---- Main Wrapper ---- */
.sip-calc-wrapper {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
    margin-bottom: 30px;
    align-items: start;
}

/* ===== INPUT PANEL ===== */
.sip-input-panel {
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.sip-input-panel h2 {
    font-size: 20px;
    color: #1f2937;
    margin-bottom: 24px;
    font-weight: 800;
}

/* ---- Field ---- */
.sip-field {
    margin-bottom: 26px;
    padding-bottom: 26px;
    border-bottom: 1px solid #f3f4f6;
}

.sip-field:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.sip-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sip-field-header label {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
}

.sip-val-display {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1.5px solid #86efac;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 16px;
    font-weight: 800;
    color: #065f46;
    min-width: 80px;
    text-align: center;
}

/* Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    outline: none;
    cursor: pointer;
    margin-bottom: 6px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    border: 2px solid #fff;
    transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.sip-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 10px;
}

/* Manual input */
.sip-manual-input {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.sip-manual-input:focus-within {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.sip-prefix {
    background: #f3f4f6;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 700;
    color: #374151;
    border-right: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.sip-suffix {
    background: #f3f4f6;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    border-left: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.sip-manual-input input {
    border: none;
    outline: none;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    width: 100%;
    background: #fff;
}

/* Presets */
.sip-presets {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.sip-presets-label {
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sip-presets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.sip-preset-btn {
    background: #f8fafc;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.sip-preset-btn:hover {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #10b981;
    color: #065f46;
    transform: translateY(-1px);
}

/* ===== RESULT PANEL ===== */
.sip-result-panel {
    background: #fff;
    border-radius: 20px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* Donut Chart */
.sip-chart-wrap {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    padding: 28px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    border-bottom: 2px solid #bbf7d0;
}

#sipDonut {
    display: block;
}

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

.sip-donut-label {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.sip-donut-val {
    font-size: 20px;
    font-weight: 900;
    color: #065f46;
    line-height: 1;
}

/* Legend */
.sip-chart-legend {
    display: flex;
    gap: 18px;
    margin-top: 12px;
}

.sip-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.sip-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sip-dot-inv { background: #3b82f6; }
.sip-dot-ret { background: #10b981; }

/* Result Cards */
.sip-res-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: #f0f0f0;
    border-bottom: 2px solid #f3f4f6;
}

.sip-res-card {
    background: #fff;
    padding: 18px 12px;
    text-align: center;
    transition: background 0.2s;
}

.sip-res-card:hover { background: #f8fafc; }

.sip-rc-icon  { font-size: 22px; margin-bottom: 6px; }
.sip-rc-label { font-size: 11px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.sip-rc-val   { font-size: 18px; font-weight: 900; color: #1f2937; }

.sip-card-invested .sip-rc-val { color: #1d4ed8; }
.sip-card-returns  .sip-rc-val { color: #059669; }
.sip-card-total    .sip-rc-val { color: #065f46; font-size: 20px; }

/* Wealth Row */
.sip-wealth-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 2px solid #f3f4f6;
}

.sip-wealth-item {
    padding: 14px 12px;
    text-align: center;
    border-right: 1px solid #e5e7eb;
}

.sip-wealth-item:last-child { border-right: none; }

.sip-wealth-label { font-size: 11px; font-weight: 600; color: #6b7280; display: block; margin-bottom: 4px; text-transform: uppercase; }
.sip-wealth-val   { font-size: 16px; font-weight: 800; color: #059669; }

/* Table */
.sip-table-wrap { padding: 20px; }

.sip-table-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

.sip-table-scroll {
    max-height: 280px;
    overflow-y: auto;
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
}

.sip-table-scroll::-webkit-scrollbar { width: 4px; }
.sip-table-scroll::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.sip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sip-table thead th {
    background: #1f2937;
    color: #fff;
    padding: 10px 12px;
    text-align: right;
    font-size: 12px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.sip-table thead th:first-child { text-align: left; }

.sip-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #f3f4f6;
    text-align: right;
    color: #374151;
    font-weight: 500;
}

.sip-table td:first-child {
    text-align: left;
    font-weight: 700;
    color: #1f2937;
}

.sip-col-return { color: #059669 !important; font-weight: 700 !important; }
.sip-col-total  { color: #1d4ed8 !important; font-weight: 700 !important; }

.sip-row-last td {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    font-weight: 800 !important;
    color: #065f46 !important;
    border-top: 2px solid #10b981;
}

/* ---- Info / Features ---- */
.info-box {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
}

.info-box h4 { color: #14532d; font-size: 20px; margin-bottom: 18px; }

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.info-item {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    color: #374151;
    font-size: 14px;
    line-height: 1.6;
}

.info-item strong {
    display: block;
    color: #059669;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.features-box {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
}

.features-box h4 { color: #0c4a6e; font-size: 20px; margin-bottom: 16px; }

.features-box ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }

.features-box ul li {
    font-size: 14px;
    color: #374151;
    padding-left: 22px;
    position: relative;
    line-height: 1.6;
}

.features-box ul li::before { content: '✓'; position: absolute; left: 0; color: #059669; font-weight: 700; }
.features-box ul li strong { color: #0c4a6e; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .sip-calc-wrapper { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sip-input-panel, .sip-result-panel { padding: 20px 16px; }
    .sip-res-cards { grid-template-columns: 1fr; gap: 0; }
    .sip-wealth-row { grid-template-columns: 1fr; }
    .sip-wealth-item { border-right: none; border-bottom: 1px solid #e5e7eb; }
    .sip-chart-wrap { padding: 20px 16px; }
    .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .sip-presets-grid { grid-template-columns: repeat(2, 1fr); }
    .sip-res-cards { grid-template-columns: 1fr; }
    .sip-donut-val { font-size: 16px; }
}