/* Additional inline styles can be added here if necessary */
/* Reset and Base Styles */
    /* Your existing CSS with improvements for responsiveness */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3a7bd5;
    --secondary-color: #00d2ff;
    --accent-color: #ff6b6b;
    --success-color: #4CAF50;
    --warning-color: #ff9f43;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --text-color: #2d3436;
    --text-light: #ffffff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --gradient-primary: linear-gradient(135deg, #4b6d91, #3c5774);
    --gradient-secondary: linear-gradient(135deg, #82bcfa, #426589);
    --glass-bg: rgba(255, 255, 255, 0.518);
    --highlight: #4361ee;
    --highlight-gradient: linear-gradient(135deg, #4361ee, #3a0ca3);
}

body {
    font-family: 'Montserrat';
    background: linear-gradient(to bottom right, #F8F9FA, #E1F5C4);
    min-height: 100vh;
    margin: 0;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* Header Styles */
.header {
    text-align: center;
    color: rgb(0, 0, 0);
    margin-bottom: 40px;
    padding: 0 15px;
}

.header h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-bottom: 10px;
    font-weight: 500;
}

.header p {
    font-size: clamp(1rem, 3vw, 1.2rem);
    opacity: 0.9;
}

/* Main Content Grid */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

/* Calculator Section */
.calculator-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.calculator-header {
    background: var(--gradient-primary);
    color: white;
    padding: 20px;
    text-align: center;
}

.calculator-header h2 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 600;
}

.calculator-body {
    padding: 30px;
}

/* Input Rows */
.input-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.input-group {
    flex: 1;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.input-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-group input:hover {
    border-color: #d1d5db;
}

/* Button Group */
.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

/* Buttons */
.remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.remove-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.add-row-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-row-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.add-row-btn:active {
    transform: translateY(0);
}

/* Reset Button Styles */
.reset-btn {
    background:  var(--gradient-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.reset-btn:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.reset-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 18px;
    font-weight: bold;
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.results-header {
    background: var(--gradient-primary);
    color: white;
    padding: 20px;
    text-align: center;
}

.results-header h2 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 600;
}

.results-body {
    padding: 30px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
    transition: all 0.3s ease;
}

.result-item:hover {
    background: #f1f5f9;
    transform: translateX(5px);
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-label {
    font-weight: 600;
    color: #374151;
    font-size: 1rem;
}

.result-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2563eb;
}

/* Information Section */
.info-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 30px;
    margin-bottom: 40px;
}

.info-section h2 {
    margin-bottom: 20px;
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    font-weight: 700;
}

.info-section h3 {
    color: #374151;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 600;
}

.info-section p {
    margin-bottom: 15px;
    line-height: 1.7;
    color: #4b5563;
}

/* Formula Box */
.formula {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
    font-family: 'Courier New', monospace;
    margin: 20px 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1f2937;
    overflow-x: auto;
}

/* Benefits Grid */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.benefit-card {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #10b981;
    transition: all 0.3s ease;
}

.benefit-card:hover {
    background: #f0fdf4;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.15);
}

.benefit-card h4 {
    color: #059669;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.benefit-card p {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.6;
}


/* Error States */
.error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Animations */
.success-animation {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.05); 
        background-color: #dbeafe;
    }
    100% { 
        transform: scale(1); 
    }
}

/* Reset Animation */
.reset-animation {
    animation: resetPulse 0.6s ease-out;
}

@keyframes resetPulse {
    0% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: scale(0.95);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading Animation */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ===== IMPROVED NAVIGATION SYSTEM ===== */
.navbar {
display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    width: 90%;
    height: 9vh;
    max-width: 1100px;
    margin: 0.5rem auto;
    position: sticky;
    top: 10px;
    z-index: 1000;
    background: #7aacde93;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 1.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Slight hover lift */
.navbar:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.15);
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hamburger {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 2100;
    padding: 8px;
    border-radius: 5px;
    transition: background 0.3s;
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hamburger span {
    width: 35px;
    height: 3px;
    background: rgb(0, 0, 0);
    border-radius: 2px;
    transition: all 0.3s ease;
}


/* Hamburger animation when active */
.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Side Menu */
.calculator-nav {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100%;
    background: linear-gradient(135deg, #3c4a59, #34495e);
    padding: 80px 20px 20px 20px;
    overflow-y: auto;
    transition: right 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 1500;
    box-shadow: -4px 0 25px rgba(0, 0, 0, 0.2);
}

.calculator-nav.active {
    right: 0;
}

/* Close button */
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Category styles */
.nav-category {
    margin-bottom: 10px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.05);
}

.category-btn {
    width: 100%;
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.category-btn i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.category-btn .arrow {
    transition: transform 0.3s ease;
}

.category-btn.active .arrow {
    transform: rotate(180deg);
}

/* Submenu */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: rgba(0, 0, 0, 0.2);
}

.submenu.active {
    max-height: 500px;
}

.submenu .nav-btn {
    background: none;
    border: none;
    text-align: left;
    color: #ddd;
    padding: 12px 20px 12px 50px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    width: 100%;
}

.submenu .nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding-left: 55px;
}

.nav-btn.active {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

.nav-icon {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* Keep "always-open" category expanded */
.nav-category.always-open .submenu {
    max-height: none !important;
    /* no collapse */
    background: rgba(0, 0, 0, 0.2);
}

.nav-category.always-open .category-btn {
    cursor: default;
    justify-content: flex-start;
}

.nav-category.always-open .arrow {
    display: none;
    /* hide arrow since no toggle */
}


/* Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1200;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design Improvements */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .main-content {
        gap: 30px;
    }
    
    .calculator-body, .results-body {
        padding: 25px;
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .header p {
        font-size: 1rem;
    }

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

    .remove-btn {
        width: 100%;
        height: 40px;
        border-radius: 8px;
        font-size: 16px;
    }

    .button-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .calculator-body,
    .results-body,
    .info-section {
        padding: 20px;
    }
    
    .navbar {
        padding: 1rem;
    }

    .calculator-nav {
        width: 300px;
        right: -300px;
    }

    .submenu .nav-btn {
        padding: 10px 15px 10px 45px;
    }

    .submenu .nav-btn:hover {
        padding-left: 50px;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .result-value {
        font-size: 1.1rem;
    }
}

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

    .result-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .result-value {
        margin-top: 5px;
        font-size: 1.1rem;
    }

    .calculator-body,
    .results-body,
    .info-section {
        padding: 15px;
    }

    .add-row-btn,
    .reset-btn {
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .calculator-nav {
        width: 280px;
        right: -280px;
        padding: 70px 15px 15px 15px;
    }
    
    .benefit-card {
        padding: 15px;
    }
    
    .formula {
        padding: 15px;
        font-size: 0.85rem;
    }
    
    .input-group input {
        padding: 10px;
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 10px;
    }
    
    .calculator-nav {
        width: 100%;
        right: -100%;
    }
    
    .calculator-body,
    .results-body,
    .info-section {
        padding: 10px;
    }
    
    .header {
        margin-bottom: 20px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .input-group input {
        border-width: 3px;
    }

    .result-item {
        border-left-width: 6px;
    }

    .benefit-card {
        border-left-width: 6px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Button Disabled State */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

button:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Additional responsive improvements */
.input-row:last-of-type {
    margin-bottom: 0;
}

.calculator-section, .results-section {
    min-height: 300px;
}

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* ===== FOOTER STYLES ===== */
footer {
    background: linear-gradient(135deg, #4b6d91, #3c5774);
    color: #fff;
    text-align: center;
    padding: 40px 20px 20px;
    font-family: Arial, sans-serif;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Social Icons */
.footer-social {
    margin-bottom: 20px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    text-decoration: none;
    height: 45px;
    margin: 0 8px;
    background: #fff;
    color: #000;
    border-radius: 50%;
    font-size: 20px;
    transition: all 0.3s ease;
}

.footer-social a:hover {
    transform: translateY(-4px);
    background: #7777778f;
    color: #000;
}

/* Footer Links */
.footer-links {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s ease;
    position: relative;
}

.footer-links a:hover {
    color: #c4c1c1f0;
}

/* Tooltip from data-desc */
.footer-links a::after {
    content: attr(data-desc);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.footer-links a:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    bottom: -35px;
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    margin-top: 20px;
    padding-top: 15px;
}

.footer-bottom p {
    font-size: 14px;
    opacity: 0.9;
}

.footer-bottom span {
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    footer {
        padding: 2rem 1rem;
    }

    .footer-links {
        gap: 15px;
    }

    .footer-links a {
        font-size: 14px;
    }

    .footer-links a::after {
        display: none;
        /* hide tooltips on small screens */
    }

    .footer-social a {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .footer-bottom p {
        font-size: 12px;
    }
    .popular-links a {
    color: #fff;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.3s ease;
    }
}
.popular-links a {
    color: #fff;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.popular-links a:hover {
    color: #c4c1c1f0;
    text-decoration: underline;
}