/* ===== Modern Reset & Base ===== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --light: #f8fafc;
    --dark: #1e293b;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --border-radius: 16px;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== Main Calculator Container ===== */
.afc-wrapper {
    display: flex;
    gap: 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
    border: 1px solid var(--gray-light);
    position: relative;
    overflow: hidden;
}

.afc-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.afc-left, .afc-center, .afc-right {
    flex: 1 1 300px;
}

/* ===== Left Panel - Inputs ===== */
.afc-left h3 {
    color: var(--dark);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.afc-left h3::before {
    content: '';
    font-size: 20px;
}

/* Tabs */
.afc-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: var(--gray-light);
    padding: 6px;
    border-radius: 12px;
}

.afc-tab {
    flex: 1;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
    color: var(--gray);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.afc-tab::before {
    font-size: 16px;
}

.afc-tab[data-mode="sip"]::before {
    content: '';
}

.afc-tab[data-mode="lumpsum"]::before {
    content: '';
}

.afc-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

/* Input Fields */
.afc-left label {
    display: block;
    margin-bottom: 25px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    position: relative;
}

.afc-left label span {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--gray);
    font-weight: 500;
}

.afc-range {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, var(--primary) 0%, var(--gray-light) 0%);
    border-radius: 10px;
    outline: none;
    transition: var(--transition);
}

.afc-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transition: var(--transition);
}

.afc-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.afc-num {
    width: 100%;
    margin-top: 12px;
    padding: 14px 16px;
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    background: white;
    transition: var(--transition);
}

.afc-num:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Calculate Button */
.afc-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 18px;
    border-radius: 12px;
    width: 100%;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.25);
}

.afc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}

.afc-btn::before {
    content: '';
    font-size: 18px;
}

/* ===== Center Panel - Results ===== */
.afc-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-light);
}

.afc-big {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.afc-chart {
    max-height: 280px;
    margin: 20px 0;
}

/* Results Table */
.afc-results {
    margin-top: 30px;
    background: var(--light);
    border-radius: 12px;
    padding: 20px;
}

.afc-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--gray-light);
}

.afc-result-row:last-child {
    border-bottom: none;
}

.afc-result-label {
    color: var(--gray);
    font-size: 14px;
    font-weight: 500;
}

.afc-result-value {
    color: var(--dark);
    font-size: 18px;
    font-weight: 700;
}

.afc-result-value.highlight {
    color: var(--success);
    font-size: 20px;
}

/* ===== Right Panel - Info ===== */
.afc-right {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: var(--border-radius);
    padding: 25px;
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.afc-right h4 {
    color: var(--dark);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.afc-right h4::before {
    content: '';
}

.afc-right p {
    color: var(--gray);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.afc-tips {
    list-style: none;
    margin-top: 20px;
}

.afc-tips li {
    padding: 10px 0 10px 30px;
    color: var(--gray);
    font-size: 14px;
    position: relative;
}

.afc-tips li::before {
    content: '';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .afc-wrapper {
        gap: 20px;
        padding: 25px;
    }
    
    .afc-big {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .afc-wrapper {
        flex-direction: column;
        margin: 20px 10px;
        padding: 20px;
    }
    
    .afc-left, .afc-center, .afc-right {
        flex: 1 1 100%;
    }
    
    .afc-big {
        font-size: 32px;
    }
    
    .afc-chart {
        max-height: 250px;
    }
}

@media (max-width: 480px) {
    .afc-wrapper {
        padding: 15px;
        border-radius: 12px;
    }
    
    .afc-big {
        font-size: 28px;
    }
    
    .afc-btn {
        padding: 16px;
    }
    
    .afc-tab {
        padding: 10px;
        font-size: 13px;
    }
}