:root { 
    --meezan-green: #007565; 
    --bg: #f0f4f3; 
    --text: #333; 
}

/* Page-specific styles for index.html */
body { 
    background: var(--bg); 
    display: flex; 
    justify-content: center; 
}

.main-container { 
    display: grid; 
    grid-template-columns: 2.5fr auto 1fr; 
    gap: 20px; 
    position: relative; 
    align-items: start; 
}

.input-section { 
    display: flex; 
    flex-direction: column; 
}

.results-section { 
    display: flex; 
    flex-direction: column; 
    align-self: start; 
    margin-top: 20px; 
}

.column-divider { 
    width: 2px; 
    background: #eee; 
    margin: 0 10px; 
}

/* RTL Support for Urdu, Pashto, and Hindko */
body[dir="rtl"] .main-container { 
    direction: rtl; 
    grid-template-columns: 1fr auto 2.5fr; /* Flip columns: results first, then divider, then inputs */
}

body[dir="rtl"] .input-section { 
    text-align: right; 
    order: 3;
}

body[dir="rtl"] .results-section { 
    text-align: right; 
    order: 1;
}

body[dir="rtl"] .column-divider { 
    order: 2;
}

body[dir="rtl"] .stat-box { 
    text-align: right; 
}

body[dir="rtl"] .stat-row { 
    flex-direction: row-reverse; 
    justify-content: space-between;
}

body[dir="rtl"] .input-row { 
    direction: rtl; 
    text-align: right;
}

body[dir="rtl"] label { 
    text-align: right; 
}

body[dir="rtl"] .footer { 
    text-align: center; 
}

body[dir="rtl"] .shareable-card { 
    transform: rotate(1deg); 
}

body[dir="rtl"] .stat-label { 
    text-align: right; 
}

body[dir="rtl"] .stat-value { 
    text-align: right; 
}

body[dir="rtl"] .stat-title { 
    text-align: right; 
}

body[dir="rtl"] .stat-number { 
    text-align: left; 
}

body[dir="rtl"] h1 { 
    text-align: center; 
}

body[dir="rtl"] .tooltip { 
    left: auto; 
    right: 50%; 
    transform: translateX(50%); 
}

body[dir="rtl"] .tooltip::after { 
    left: auto; 
    right: 50%; 
    transform: translateX(50%); 
}

body[dir="rtl"] input { 
    text-align: right; 
    direction: rtl; 
}

body[dir="rtl"] input[type="number"] { 
    direction: ltr; 
    text-align: right; 
}

body[dir="rtl"] .slider-container { 
    direction: rtl; 
}

body[dir="rtl"] .share-buttons { 
    direction: ltr; 
}

.shareable-card { 
    background: #fff9c4; 
    border: 2px solid #fdd835; 
    border-radius: 2px; 
    padding: 15px; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.1); 
    transform: rotate(-1deg); 
    position: relative; 
}

.shareable-card::before { 
    content: ''; 
    position: absolute; 
    top: -2px; 
    right: 30px; 
    width: 20px; 
    height: 20px; 
    background: #fff9c4; 
    border: 2px solid #fdd835; 
    border-bottom: none; 
    border-right: none; 
    transform: rotate(45deg); 
}

.shareable-card .stat-box { 
    padding: 6px; 
    margin-bottom: 5px; 
    background: rgba(255,255,255,0.5); 
    border-left: 3px solid #fdd835; 
}

.shareable-card .stat-title { 
    font-size: 0.65rem; 
}

.shareable-card .stat-value { 
    font-size: 0.9rem; 
}

.shareable-card .stat-label { 
    font-size: 0.7rem; 
}

.shareable-card .stat-number { 
    font-size: 0.75rem; 
}

.share-buttons { 
    display: flex; 
    gap: 12px; 
    margin-top: 15px; 
    justify-content: center; 
}

.share-btn { 
    width: 45px; 
    height: 45px; 
    border: none; 
    border-radius: 50%; 
    cursor: pointer; 
    transition: all 0.3s; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.2); 
}

.share-btn:hover { 
    transform: scale(1.1); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); 
}

.share-btn svg { 
    width: 24px; 
    height: 24px; 
}

.share-btn-whatsapp { 
    background: #25D366; 
}

.share-btn-email { 
    background: #007565; 
}

.share-btn-twitter { 
    background: #1DA1F2; 
}

.share-btn-copy { 
    background: #6c757d; 
}

.mode-selector { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 20px; 
}

.mode-btn { 
    flex: 1; 
    padding: 12px; 
    border: 2px solid var(--meezan-green); 
    background: white; 
    color: var(--meezan-green); 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 600; 
    transition: all 0.3s; 
}

.mode-btn.active { 
    background: var(--meezan-green); 
    color: white; 
}

.input-row { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 12px; 
    margin-bottom: 20px; 
}

.input-full { 
    margin-bottom: 20px; 
}

label { 
    display: block; 
    margin-bottom: 8px; 
    font-size: 0.85rem; 
    font-weight: 600; 
    color: #666; 
}

.label-hint { 
    font-size: 0.75rem; 
    color: #999; 
    font-weight: normal; 
    margin-left: 5px; 
}

.help-icon { 
    display: inline-block; 
    width: 16px; 
    height: 16px; 
    background: var(--meezan-green); 
    color: white; 
    border-radius: 50%; 
    text-align: center; 
    line-height: 16px; 
    font-size: 11px; 
    font-weight: bold; 
    cursor: help; 
    margin-left: 5px; 
    vertical-align: middle; 
}

.tooltip-container { 
    position: relative; 
    display: inline-block; 
    z-index: 1000; 
}

.tooltip { 
    visibility: hidden; 
    position: absolute; 
    background: #333; 
    color: white; 
    padding: 12px; 
    border-radius: 8px; 
    font-size: 0.8rem; 
    width: 280px; 
    z-index: 10000; 
    bottom: 125%; 
    left: 50%; 
    transform: translateX(-50%); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); 
    white-space: normal; 
}

.tooltip::after { 
    content: ""; 
    position: absolute; 
    top: 100%; 
    left: 50%; 
    transform: translateX(-50%); 
    border: 6px solid transparent; 
    border-top-color: #333; 
}

.tooltip-container:hover .tooltip { 
    visibility: visible; 
}

.tooltip:hover { 
    visibility: visible; 
}

.input-section, .results-section { 
    overflow: visible; 
}

.main-container { 
    overflow: visible; 
}

.tooltip-title { 
    font-weight: bold; 
    margin-bottom: 8px; 
    color: #fff; 
}

.tooltip-example { 
    margin-top: 8px; 
    line-height: 1.6; 
}

.tooltip-year { 
    display: flex; 
    justify-content: space-between; 
    padding: 2px 0; 
}

.tooltip-year-label { 
    color: #ccc; 
}

.tooltip-year-value { 
    font-weight: bold; 
}

.tooltip-toggle { 
    display: flex; 
    gap: 5px; 
    margin-bottom: 10px; 
    border-bottom: 1px solid #555; 
    padding-bottom: 8px; 
}

.tooltip-toggle-btn { 
    flex: 1; 
    padding: 5px 8px; 
    background: #555; 
    color: #fff; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 0.75rem; 
    text-align: center; 
    transition: background 0.2s; 
}

.tooltip-toggle-btn:hover { 
    background: #666; 
}

.tooltip-toggle-btn.active { 
    background: var(--meezan-green); 
}

input { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    font-size: 1rem; 
    box-sizing: border-box; 
}

input:disabled { 
    background: #f5f5f5; 
    color: #999; 
}

input[type="range"] { 
    width: 100%; 
    height: 8px; 
    border-radius: 5px; 
    background: #ddd; 
    outline: none; 
    -webkit-appearance: none; 
    appearance: none; 
}

input[type="range"]::-webkit-slider-thumb { 
    -webkit-appearance: none; 
    appearance: none; 
    width: 20px; 
    height: 20px; 
    border-radius: 50%; 
    background: var(--meezan-green); 
    cursor: pointer; 
}

input[type="range"]::-moz-range-thumb { 
    width: 20px; 
    height: 20px; 
    border-radius: 50%; 
    background: var(--meezan-green); 
    cursor: pointer; 
    border: none; 
    appearance: none; 
}

.slider-container { 
    display: flex; 
    gap: 10px; 
    align-items: center; 
}

.slider-container input[type="range"] { 
    flex: 1; 
}

.slider-value { 
    min-width: 60px; 
    text-align: center; 
    font-weight: bold; 
    color: var(--meezan-green); 
    font-size: 1rem; 
}

.checkbox-container { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 15px; 
    padding: 12px; 
    background: #f9f9f9; 
    border-radius: 8px; 
}

.checkbox-container input[type="checkbox"] { 
    width: 20px; 
    height: 20px; 
    cursor: pointer; 
}

.checkbox-container label { 
    margin: 0; 
    font-size: 0.9rem; 
    cursor: pointer; 
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin: 0;
    flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
    z-index: 1;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    z-index: 2;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background-color: var(--meezan-green);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input[type="checkbox"]:focus + .toggle-slider {
    box-shadow: 0 0 1px var(--meezan-green);
}

.toggle-switch:hover .toggle-slider {
    background-color: #b3b3b3;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider:hover {
    background-color: #005a2f;
}

button { 
    width: 100%; 
    padding: 15px; 
    background: var(--meezan-green); 
    color: white; 
    border: none; 
    border-radius: 8px; 
    font-weight: bold; 
    cursor: pointer; 
    margin-top: 20px; 
    font-size: 1.1rem; 
    transition: background 0.3s; 
}

button:hover { 
    background: #005a4d; 
}

.results { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

.results.hidden { 
    display: none; 
}

.results-section .shareable-card { 
    margin-top: 0; 
    padding-top: 15px; 
}

.stat-box { 
    background: #e6f4f1; 
    padding: 15px; 
    border-radius: 10px; 
    border-left: 5px solid var(--meezan-green); 
}

.stat-title { 
    font-size: 0.8rem; 
    color: #555; 
    display: block; 
    margin-bottom: 5px; 
}

.stat-value { 
    font-size: 1.3rem; 
    font-weight: bold; 
    color: var(--meezan-green); 
    display: block; 
}

.stat-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 8px; 
}

.stat-row:last-child { 
    margin-bottom: 0; 
}

.stat-label { 
    font-size: 0.85rem; 
    color: #666; 
}

.stat-number { 
    font-size: 1rem; 
    font-weight: 600; 
    color: var(--meezan-green); 
}

.inflation-warning { 
    color: #d35400; 
    font-size: 0.75rem; 
    padding: 8px 12px; 
    background: #fff3e0; 
    border-radius: 6px; 
    margin-top: 10px; 
    line-height: 1.4; 
    border-left: 3px solid #d35400; 
}

/* Explanation Section */
.explanation-toggle {
    width: 100%;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 2px solid var(--meezan-green);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--meezan-green);
    transition: all 0.3s;
    margin-bottom: 0;
}

.explanation-toggle:hover {
    background: #e6f4f1;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.explanation-toggle span:last-child {
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.explanation-toggle.active span:last-child {
    transform: rotate(180deg);
}

.explanation-content {
    display: block;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 20px;
    margin-top: 0;
}

.explanation-section {
    margin-bottom: 20px;
}

.explanation-section:last-child {
    margin-bottom: 0;
}

.explanation-section h3 {
    color: var(--meezan-green);
    font-size: 1rem;
    margin-bottom: 10px;
    margin-top: 0;
}

.explanation-section p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 10px;
}

.explanation-section ul, .explanation-section ol {
    font-size: 0.9rem;
    line-height: 1.8;
    color: #555;
    margin-left: 20px;
    margin-bottom: 10px;
}

.explanation-section li {
    margin-bottom: 5px;
}

.explanation-formula {
    background: #fff;
    padding: 12px;
    border-left: 4px solid var(--meezan-green);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    margin: 10px 0;
    overflow-x: auto;
}

body[dir="rtl"] .explanation-section ul, body[dir="rtl"] .explanation-section ol {
    margin-left: 0;
    margin-right: 20px;
}

body[dir="rtl"] .explanation-formula {
    border-left: none;
    border-right: 4px solid var(--meezan-green);
}

.explanation-intro {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.explanation-intro p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #444;
}

.explanation-disclaimer {
    margin-top: 30px;
    padding: 15px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
}

.explanation-disclaimer h4 {
    color: #856404;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1rem;
}

.explanation-disclaimer p {
    color: #856404;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 8px;
}

.explanation-disclaimer ul {
    color: #856404;
    font-size: 0.85rem;
    line-height: 1.8;
    margin-left: 20px;
    margin-top: 10px;
}

.explanation-disclaimer li {
    margin-bottom: 6px;
}

.explanation-dynamic {
    color: var(--meezan-green);
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 968px) {
    .main-container { 
        grid-template-columns: 1fr; 
        gap: 15px; 
    }
    .column-divider { 
        display: none; 
    }
    .results-section { 
        margin-top: 0 !important; 
    }
}

@media (max-width: 768px) {
    .input-row { 
        grid-template-columns: 1fr; 
        gap: 15px; 
        margin-bottom: 15px; 
    }
    .input-full { 
        margin-bottom: 15px; 
    }
    label { 
        font-size: 0.9rem; 
        margin-bottom: 6px; 
    }
    input { 
        padding: 14px; 
        font-size: 16px; /* Prevents zoom on iOS */ 
    }
    .slider-container { 
        flex-direction: column; 
        gap: 8px; 
    }
    .slider-value { 
        font-size: 1.1rem; 
    }
    .shareable-card { 
        padding: 12px !important; 
        margin-top: 15px !important; 
    }
    .share-buttons { 
        gap: 10px; 
        flex-wrap: wrap; 
        justify-content: center; 
    }
    .share-btn { 
        width: 50px; 
        height: 50px; 
    }
    .share-btn svg { 
        width: 22px; 
        height: 22px; 
    }
    .stat-box { 
        padding: 12px; 
        margin-bottom: 8px; 
    }
    .stat-title { 
        font-size: 0.75rem; 
    }
    .stat-value { 
        font-size: 1.1rem; 
    }
    .stat-label { 
        font-size: 0.8rem; 
    }
    .stat-number { 
        font-size: 0.9rem; 
    }
    .tooltip { 
        width: 90vw; 
        max-width: 300px; 
        font-size: 0.75rem; 
        padding: 10px; 
    }
    .results-grid { 
        grid-template-columns: 1fr; 
    }
}

@media (max-width: 375px) {
    .input-row { 
        gap: 12px; 
        margin-bottom: 12px; 
    }
    input { 
        padding: 12px; 
    }
    .shareable-card { 
        padding: 10px !important; 
    }
    .stat-box { 
        padding: 10px; 
    }
}

@media (max-width: 968px) and (orientation: landscape) {
    .input-row { 
        grid-template-columns: 1fr 1fr; 
        gap: 10px; 
    }
    .results-section { 
        margin-top: 0 !important; 
    }
}

