/* POST OFFICE MIS CALCULATOR STYLESHEET v1.2 (Final) */

/* --- Core Variables & Base Styles --- */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
    --card-bg-color: #ffffff;
    --text-color: #212529;
    --label-color: #495057;
    --body-bg-color: #f4f7f6;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--body-bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.card {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

/* --- Page Header --- */
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.1rem;
    color: var(--label-color);
    max-width: 700px;
    margin: 0 auto;
}

.last-updated {
    font-size: 0.9rem;
    color: var(--label-color);
    margin-top: 0.5rem;
    font-style: italic;
}

/* --- Main Layout --- */
.main-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2.5rem;
    align-items: flex-start;
}
.calculator-column {
    position: sticky;
    top: 2rem;
}
.content-column {
    min-width: 0; /* Prevents content from overflowing its container */
}

/* --- Calculator Form Styles --- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.radio-label {
    display: inline-block;
    position: relative;
    cursor: pointer;
}
.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.radio-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--light-gray);
    transition: all 0.3s ease;
    font-weight: 600;
}
.radio-label input[type="radio"]:checked + .radio-custom {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(0,123,255,0.2);
}
.radio-label input[type="radio"]:focus + .radio-custom {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.input-wrapper .icon {
    padding: 0 12px;
    background-color: var(--light-gray);
    align-self: stretch;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--border-color);
    color: var(--label-color);
}

.input-wrapper input[type="number"] {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px;
    width: 100%;
    background-color: var(--card-bg-color);
    color: var(--text-color);
    font-size: 1rem;
}

.slider-group {
    margin-top: 0.75rem;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: var(--light-gray);
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
}

input[type="range"]:hover {
    opacity: 1;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.static-value {
    background-color: var(--light-gray);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    color: var(--label-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}
.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.2);
}
.btn-secondary {
    background-color: var(--light-gray);
    color: var(--text-color);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background-color: #e2e6ea;
    border-color: #dae0e5;
}

/* --- Results Section --- */
.results-card h2, .info-section h2 {
    font-size: 1.5rem;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}
.info-section h2 .icon, .results-card h2 .icon {
    color: var(--primary-color);
    margin-right: 0.75rem;
}

.edit-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-edit {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.btn-edit:hover {
    background-color: var(--light-gray);
}

.results-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--label-color);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}
.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.5s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.result-item {
    background-color: var(--light-gray);
    padding: 1.25rem;
    border-radius: 8px;
}
.result-item p {
    margin: 0 0 0.5rem 0;
    color: var(--label-color);
    font-weight: 600;
}
.result-item .value {
    font-weight: 700;
    font-size: 1.5rem;
    word-break: break-all;
    color: var(--primary-color);
}

.chart-container {
    max-width: 350px;
    min-height: 350px; 
    margin: 0 auto;
    position: relative;
}

/* --- Info & FAQ Sections --- */
.feature-list {
    list-style: none;
    padding-left: 0;
}
.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}
.feature-list .feature-icon {
    color: var(--success-color);
    font-size: 1.2rem;
    margin-top: 0.25rem;
}

.calculation-step {
    margin-bottom: 1.5rem;
}
.calculation-step h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}
.formula-box {
    margin-top: 1rem;
    padding: 1.5rem;
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-color);
    border-radius: 8px;
    font-size: 1.1rem;
    text-align: center;
    font-family: monospace;
}

.faq-item {
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.faq-item[open] {
    background-color: #fff;
}
.faq-item summary {
    font-weight: 600;
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-item summary:hover {
    background-color: var(--light-gray);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    transition: transform 0.3s ease-in-out;
    color: var(--primary-color);
}
.faq-item[open] > summary {
    border-bottom: 1px solid var(--border-color);
}
.faq-item[open] summary::after {
    transform: rotate(180deg);
}
.faq-item div {
    padding: 1.25rem;
    line-height: 1.8;
}

/* --- Language Switcher --- */
.section-lang-switcher {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}
.section-lang-switcher .lang-btn {
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    color: var(--label-color);
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.section-lang-switcher .lang-btn:first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.section-lang-switcher .lang-btn:last-child { border-top-right-radius: 6px; border-bottom-right-radius: 6px; border-left: none; }
.section-lang-switcher .lang-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
.card > .section-lang-switcher { margin-top: -0.5rem; }


/* --- Full Width Content Section Styles --- */
.full-width-container {
    grid-column: 1 / -1;
}
.card.info-card-full {
    width: 100%;
}
.table-container { overflow-x: auto; border: 1px solid var(--border-color); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border-color); }
th { background-color: #f8f9fa; font-weight: 600; color: var(--primary-color); }
tr:last-child td { border-bottom: none; }
.scenario-box { background-color: #e6f7ff; border-left: 5px solid var(--primary-color); padding: 1.5rem; border-radius: 8px; margin-top: 1rem; }
.scenario-box h3 { color: #0056b3; margin-top: 0; }
.scenario-box ul { list-style-position: inside; padding-left: 0; }
.tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin-top: 1rem; }
.tip-card { background-color: #f8f9fa; padding: 1.5rem; border-radius: 12px; }
.tip-card h4 { color: var(--primary-color); margin-top: 0; margin-bottom: 0.5rem; }


/* --- Responsive Design --- */
@media (max-width: 992px) {
    .main-container { grid-template-columns: 1fr; }
    .calculator-column { position: static; }
}
@media (max-width: 768px) {
    .container { padding-left: 0; padding-right: 0; }
    .card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: 0 5px 15px rgba(0,0,0,0.02);
        padding: 1.5rem 1rem;
    }
    .results-card { padding-left: 1rem; padding-right: 1rem; }
    .result-item .value { font-size: 1.2rem; }
    .page-header h1 { font-size: 2rem; }
}


/* POST OFFICE MIS CALCULATOR CSS v3.0 - All-in-One Advanced Calculator */

/* ========== NEW: FORM SECTIONS WITH CHECKBOXES ========== */

.form-section {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.form-section:hover {
    border-color: #dee2e6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-note {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 1rem;
    font-style: italic;
}

/* Checkbox Wrapper */
.checkbox-wrapper {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.checkbox-wrapper:hover {
    border-color: #007bff;
    box-shadow: 0 2px 12px rgba(0, 123, 255, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 600;
}

.checkbox-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    margin-top: 0.2rem;
    accent-color: #007bff;
}

.checkbox-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-desc {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.5rem;
    margin-left: 2.5rem;
    line-height: 1.5;
}

/* Conditional Inputs (Hidden by default) */
.conditional-inputs {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px dashed #dee2e6;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RESULTS TABS (4 TABS) ========== */

.results-tabs .tab-btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0;
}

.results-tabs .tab-btn {
    flex: 1;
    min-width: 140px;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.results-tabs .tab-btn:hover {
    color: #007bff;
    background: #f8f9fa;
}

.results-tabs .tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: #e7f1ff;
}

.results-content .tab-panel {
    display: none;
    animation: fadeIn 0.4s ease;
}

.results-content .tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========== ADVANCED RESULT STYLES ========== */

/* Penalty Status Badge */
.penalty-status-badge {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.penalty-status-badge.status-not-allowed {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.penalty-status-badge.status-2\%-penalty {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffeaa7;
}

.penalty-status-badge.status-1\%-penalty {
    background: #d1ecf1;
    color: #0c5460;
    border: 2px solid #bee5eb;
}

.penalty-status-badge.status-no-penalty {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

/* Combo Highlight Box */
.combo-highlight-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.highlight-label {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    opacity: 0.95;
}

.highlight-number {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.highlight-comparison {
    font-size: 1.15rem;
    font-weight: 600;
    opacity: 0.95;
}

/* Info Box in Results */
.info-box-result {
    background: #e7f3ff;
    border-left: 4px solid #17a2b8;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 2rem;
}

.info-box-result.warning {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.info-box-result strong {
    display: block;
    margin-bottom: 0.75rem;
    color: #17a2b8;
    font-size: 1.1rem;
}

.info-box-result.warning strong {
    color: #856404;
}

.info-box-result ul,
.info-box-result ol {
    margin-left: 1.5rem;
    margin-top: 0.75rem;
}

.info-box-result li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.info-box-result p {
    line-height: 1.6;
    margin: 0;
}

/* Result Item Variants */
.result-item.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.result-item.highlight p,
.result-item.highlight .value {
    color: white;
}

.result-item.danger {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
    color: white;
}

.result-item.danger p,
.result-item.danger .value {
    color: white;
}

.result-item.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.result-item.success p,
.result-item.success .value {
    color: white;
}

/* ========== RESPONSIVE DESIGN ========== */

@media (max-width: 768px) {
    .form-section {
        padding: 1rem;
    }

    .checkbox-wrapper {
        padding: 1rem;
    }

    .checkbox-desc {
        margin-left: 0;
        margin-top: 0.75rem;
    }

    .results-tabs .tab-btn {
        min-width: 100%;
        font-size: 0.875rem;
    }

    .highlight-number {
        font-size: 2.25rem;
    }

    .combo-highlight-box {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .form-section-title {
        font-size: 1rem;
    }

    .checkbox-title {
        font-size: 0.95rem;
    }

    .highlight-number {
        font-size: 1.875rem;
    }

    .info-box-result {
        padding: 1rem;
        font-size: 0.9rem;
    }
}
/* ========== STICKY CALCULATE BUTTON ========== */

.form-actions {
    position: relative;
    z-index: 10;
    transition: all 0.3s ease;
}

.form-actions.sticky-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 1.25rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    border-top: 3px solid #007bff;
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.form-actions.sticky-actions .btn {
    font-size: 1.1rem;
    padding: 1rem 2rem;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.form-actions.sticky-actions .btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.form-actions.sticky-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

/* Desktop: Sticky button stays within calculator column width */
@media (min-width: 992px) {
    .form-actions.sticky-actions {
        left: auto;
        right: auto;
        width: 100%;
        max-width: 500px;
        margin-left: 0;
        border-radius: 12px 12px 0 0;
    }
}

/* Tablet and Mobile: Full width sticky button */
@media (max-width: 991px) {
    .form-actions.sticky-actions {
        left: 0;
        right: 0;
        width: 100%;
    }

    .form-actions.sticky-actions .btn {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
}

/* Extra small mobile: Adjust button sizes */
@media (max-width: 480px) {
    .form-actions.sticky-actions {
        padding: 1rem;
    }

    .form-actions.sticky-actions .btn {
        font-size: 0.95rem;
        padding: 0.75rem 1.25rem;
    }
}

/* ========== *** NEW: Custom Stepper Buttons *** ========== */

.input-wrapper input[type="number"] {
    /* Remove default browser spinners */
    -moz-appearance: textfield;
}

.input-wrapper input[type="number"]::-webkit-outer-spin-button,
.input-wrapper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stepper-group {
    display: flex;
    flex-direction: column;
    align-self: stretch; /* Make group fill height of wrapper */
    flex-shrink: 0;
}

.stepper-btn {
    background-color: var(--light-gray);
    border: none;
    border-left: 1px solid var(--border-color);
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 36px;
    height: 50%; /* Each button takes half the height */
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stepper-btn:hover {
    background-color: #e2e6ea;
}

.stepper-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

.stepper-btn.stepper-up {
    border-bottom: 1px solid var(--border-color);
}