/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: #fcfdfe;
    color: #111827;
    min-height: 100vh;
    line-height: 1.6;
}
body::before {
    content: '';
    position: fixed; inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 20% 10%, rgba(0, 171, 228, 0.05), transparent),
        radial-gradient(ellipse 500px 500px at 80% 80%, rgba(0, 139, 185, 0.04), transparent);
    pointer-events: none; z-index: 0;
}

/* ===== Header ===== */
.header {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 171, 228, 0.08);
    padding: 1.25rem 2rem;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 171, 228, 0.04);
}
.header-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
}

/* Nav Pills for calculator pages */
.nav-pills { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.nav-pill {
    padding: 0.35rem 0.75rem; border-radius: 8px;
    font-size: 0.78rem; font-weight: 500; color: #4B5563;
    text-decoration: none; transition: all 0.25s;
    border: 1px solid transparent;
}
.nav-pill:hover {
    color: #00ABE4;
    background: rgba(0, 171, 228, 0.05);
    border-color: rgba(0, 171, 228, 0.1);
}
.logo { display: flex; align-items: center; gap: 0.75rem; }
.logo-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, #00ABE4, #008BB9);
    border-radius: 12px;
    display: grid; place-items: center;
    font-size: 1.3rem; font-weight: 800; color: #fff;
    box-shadow: 0 4px 16px rgba(0, 171, 228, 0.2);
}
.logo-text { font-size: 1.35rem; font-weight: 700; color: #111827; }
.logo-text .highlight {
    background: linear-gradient(135deg, #00ABE4, #008BB9);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.tagline { font-size: 0.85rem; color: #6B7280; font-weight: 400; }

/* ===== Container ===== */
.container { max-width: 1300px; margin: 2rem auto; padding: 0 1.5rem; position: relative; z-index: 1; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.calc-grid-three { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 1.5rem; align-items: start; }

@media (max-width: 1200px) {
    .calc-grid-three { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .calc-grid, .calc-grid-three { grid-template-columns: 1fr; }
}

/* ===== Unified Calculator Block ===== */
.main-calculator-block {
    max-width: 1100px;
    margin: 0 auto;
}
.unified-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2.5rem;
    align-items: stretch;
}
.input-side {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.sub-section {
    padding-bottom: 1rem;
}
.sub-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.sub-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
}
.sub-icon {
    font-size: 1.1rem;
    margin-right: 0.75rem;
    background: #f1f5f9;
    padding: 0.4rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.form-row.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-row.four-col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row.four-col { grid-template-columns: 1fr 1fr; }
}

.result-side {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    height: fit-content;
    position: sticky;
    top: 2rem;
}
.batch-summary-box {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px dashed #cbd5e1;
}
.batch-title {
    text-align: center;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

@media (max-width: 900px) {
    .unified-grid { grid-template-columns: 1fr; gap: 2rem; }
    .result-side { position: static; }
}

/* ===== Cards ===== */
.card {
    background: #ffffff;
    border: 1px solid rgba(0, 171, 228, 0.08);
    border-radius: 20px;
    overflow: hidden;
    transition: box-shadow 0.3s, border-color 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.03);
}
.card:hover {
    border-color: rgba(0, 171, 228, 0.2);
    box-shadow: 0 12px 40px rgba(0, 171, 228, 0.08);
}
.card-header {
    padding: 1.5rem 1.75rem 0.75rem;
    border-bottom: 1px solid rgba(0, 171, 228, 0.05);
}
.card-title {
    font-size: 1.15rem; font-weight: 700; color: #111827;
    display: flex; align-items: center; gap: 0.5rem;
}
.icon { font-size: 1.3rem; }
.card-body { padding: 1.5rem 1.75rem 1.75rem; }

/* ===== Form ===== */
.form-group { margin-bottom: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label {
    display: block; font-size: 0.82rem; font-weight: 600;
    color: #4B5563; margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.required { color: #ef4444; }
input[type="number"], select {
    width: 100%; padding: 0.75rem 1rem;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    color: #111827; font-size: 0.95rem; font-family: inherit;
    transition: all 0.25s;
    outline: none;
}
input[type="number"]:focus, select:focus {
    border-color: #00ABE4;
    box-shadow: 0 0 0 3px rgba(0, 171, 228, 0.15);
    background: #ffffff;
}
input::placeholder { color: #9CA3AF; }
select option { background: #ffffff; color: #111827; }

/* ===== Profit Banner ===== */
.profit-banner {
    text-align: center; padding: 1.75rem 1.5rem;
    border-radius: 16px; margin-bottom: 1.5rem;
    background: linear-gradient(135deg, rgba(34,197,94,0.08), rgba(16,185,129,0.04));
    border: 1px solid rgba(34,197,94,0.2);
    transition: all 0.4s;
}
.profit-banner.loss {
    background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(220,38,38,0.04));
    border-color: rgba(239,68,68,0.2);
}
.profit-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: #4B5563; margin-bottom: 0.25rem; }
.profit-amount { font-size: 2.5rem; font-weight: 800; color: #16a34a; transition: color 0.3s; }
.profit-banner.loss .profit-amount { color: #dc2626; }
.profit-margin { font-size: 0.9rem; color: #4B5563; margin-top: 0.25rem; }

/* ===== Fee Breakdown ===== */
.breakdown { margin-bottom: 1.5rem; }
.breakdown-title { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 1px; color: #6B7280; margin-bottom: 1rem; font-weight: 600; }
.fee-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(0, 171, 228, 0.05);
}
.fee-row:last-child { border-bottom: none; }
.fee-label { font-size: 0.9rem; color: #4B5563; }
.fee-value { font-size: 0.9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.fee-value.green { color: #16a34a; }
.fee-value.red { color: #dc2626; }
.total-row { padding: 0.85rem 0; margin-top: 0.25rem; border-top: 1px dashed rgba(0, 171, 228, 0.2); }
.divider { height: 1px; background: rgba(0, 171, 228, 0.06); margin: 0.75rem 0; }

/* ===== Bar Chart ===== */
.visual-section { margin-top: 0.5rem; }
.bar-chart {
    display: flex; height: 36px; border-radius: 10px; overflow: hidden;
    background: #f3f4f6; margin-bottom: 0.75rem;
}
.bar-segment {
    display: flex; align-items: center; justify-content: center;
    min-width: 0; transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
    overflow: hidden;
}
.bar-label { font-size: 0.7rem; font-weight: 600; color: #fff; white-space: nowrap; padding: 0 6px; }
.cost-segment { background: linear-gradient(135deg, #00ABE4, #008BB9); }
.fee-segment { background: linear-gradient(135deg, #f59e0b, #f97316); }
.profit-segment { background: linear-gradient(135deg, #22c55e, #10b981); }
.profit-segment.loss-segment { background: linear-gradient(135deg, #ef4444, #dc2626); }
.bar-legend { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: #4B5563; }
.dot { width: 10px; height: 10px; border-radius: 3px; }
.cost-dot { background: #00ABE4; }
.fee-dot { background: #f59e0b; }
.profit-dot { background: #22c55e; }

/* Info Tooltip */
.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    vertical-align: middle;
}
.info-icon {
    width: 16px;
    height: 16px;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 10px;
    font-weight: 800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    font-style: italic;
    transition: all 0.2s;
}
.info-tooltip:hover .info-icon {
    background: #00ABE4;
    color: #fff;
}
.tooltip-content {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #1f2937;
    color: #fff;
    padding: 1rem;
    border-radius: 12px;
    width: 220px;
    font-size: 0.8rem;
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    z-index: 100;
    pointer-events: none;
}
.tooltip-content.active {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.tooltip-content::after {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}
.tip-row:last-child { margin-bottom: 0; }
.tip-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}
.tip-formula {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 6px;
    font-family: monospace;
    color: #00ABE4;
    text-align: center;
}

/* Batch Summary */
#batchSummarySection {
    animation: slideUp 0.4s ease-out;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer Section */
.footer-warning {
    text-align: center;
    color: #6B7280;
    font-size: 0.85rem;
    margin-top: 1rem;
    padding-bottom: 2rem;
}

/* Header Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 200px;
    box-shadow: 0 12px 40px rgba(0, 171, 228, 0.08);
    border-radius: 12px;
    z-index: 1000;
    padding: 0.5rem 0;
    top: 100%;
    left: 0;
    border: 1px solid rgba(0, 171, 228, 0.08);
}
.dropdown-content a {
    color: #111827;
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.dropdown-content a:hover {
    background-color: rgba(0, 171, 228, 0.05);
    color: #00ABE4;
}
.dropdown:hover .dropdown-content {
    display: block;
}

/* ===== Footer ===== */
.site-footer {
    background-color: #0B1120;
    color: #9CA3AF;
    padding: 4rem 1.5rem 2rem;
    font-family: 'Inter', sans-serif;
    margin-top: 4rem;
    position: relative;
    border-top: 1px solid rgba(0, 171, 228, 0.1);
    text-align: left;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 2fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-brand {
    margin-bottom: 1.25rem;
    display: inline-flex;
}

.footer-brand .brand-text {
    color: #ffffff;
}

.footer-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #9CA3AF;
    margin-bottom: 1.5rem;
}

.social-icons {
    display: flex;
    gap: 0.8rem;
}

.social-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.2s;
}

.social-icon:hover { transform: translateY(-2px); }
.social-icon.fb { background-color: #00ABE4; }
.social-icon.x { background-color: #000; border: 1px solid #333; }
.social-icon.in { background-color: #EF4444; }
.social-icon.yt { background-color: #6B7280; }

.footer-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1.2rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #9CA3AF;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.contact-info p {
    font-size: 0.9rem;
    color: #9CA3AF;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subscribe-section {
    margin-top: 1.5rem;
}

.subscribe-section p {
    font-size: 0.85rem;
    color: #9CA3AF;
    margin-bottom: 0.8rem;
}

.subscribe-form {
    display: flex;
}

.subscribe-form input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: white;
    border-radius: 4px 0 0 4px;
    font-size: 0.9rem;
}

.subscribe-form input:focus {
    outline: none;
    border-color: #00ABE4;
}

.subscribe-form button {
    padding: 0.6rem 1rem;
    background-color: #00ABE4;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.subscribe-form button:hover {
    background-color: #008BB9;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: #6B7280;
}

.whatsapp-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: #25D366;
    color: #FFF;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.3);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.4);
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 900px) {
    .calc-grid { grid-template-columns: 1fr; }
    .header-inner { flex-direction: column; gap: 0.25rem; text-align: center; }
    .profit-amount { font-size: 2rem; }
}

@media (max-width: 600px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    .footer-brand, .social-icons, .footer-links a, .contact-info p {
        justify-content: center;
    }
    .subscribe-form {
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 500px) {
    .form-row { grid-template-columns: 1fr; }
    .card-body {
    padding: 1.5rem;
}
    .bar-legend { flex-direction: column; gap: 0.5rem; }
}
