/* ===================================================================
   Maple Leaf Tax Calculator – Styles v2
   Supports both Summary (homepage) and Full (calculator page) modes
   =================================================================== */

.mltc-wrap, .mltc-wrap * { box-sizing: border-box; margin: 0; padding: 0; }

.mltc-wrap {
    max-width: 960px;
    margin: 0 auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.5;
    background: #fff;
    border: 1px solid #c0c0c0;
    border-radius: 4px;
    overflow: hidden;
}

/* ---- Title ---- */
.mltc-title {
    background: #2d5f2d;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    padding: 14px 20px;
    letter-spacing: 0.5px;
}

/* ---- Input Section ---- */
.mltc-inputs {
    padding: 20px 24px 16px;
    background: #f9faf8;
    border-bottom: 2px solid #c0c0c0;
}

.mltc-input-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid #e8e8e8;
}
.mltc-input-row:last-of-type { border-bottom: none; }

.mltc-input-row label {
    flex: 1 1 55%;
    font-weight: 500;
    font-size: 13px;
    color: #333;
    padding-right: 12px;
}

.mltc-input-row select,
.mltc-input-row input {
    flex: 0 0 200px;
    height: 36px;
    padding: 4px 10px;
    font-size: 14px;
    border: 1px solid #b0b0b0;
    border-radius: 3px;
    background: #fff;
    color: #1a1a1a;
    font-family: inherit;
}
.mltc-input-row select:focus,
.mltc-input-row input:focus {
    outline: none;
    border-color: #2d5f2d;
    box-shadow: 0 0 0 2px rgba(45,95,45,0.15);
}

.mltc-input-with-prefix {
    flex: 0 0 200px;
    display: flex;
    align-items: center;
    position: relative;
}
.mltc-prefix {
    position: absolute;
    left: 10px;
    color: #666;
    font-size: 14px;
    pointer-events: none;
}
.mltc-input-with-prefix input { flex: 1; padding-left: 22px; }

/* Display-only rows */
.mltc-display-row label { font-weight: 600; }

.mltc-display-value {
    flex: 0 0 200px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 4px 10px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    background: #eef2ee;
    border: 1px solid #c5d0c5;
    border-radius: 3px;
    cursor: default;
    user-select: text;
}

.mltc-highlight-row .mltc-display-value {
    background: #e3fdcc;
    border-color: #7ab648;
    color: #2d5f2d;
    font-weight: 700;
    font-size: 15px;
}

.mltc-bold-row label { font-weight: 700; }
.mltc-bold-row .mltc-display-value {
    font-weight: 700;
    background: #f5f5f0;
    border-color: #aaa;
}

/* Validation */
.mltc-validation-msg {
    display: none;
    padding: 8px 12px;
    margin-top: 4px;
    margin-bottom: 4px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 3px;
    color: #856404;
    font-size: 13px;
    font-weight: 500;
}

.mltc-footnotes-inputs {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}
.mltc-footnotes-inputs p { font-size: 11px; color: #777; margin-bottom: 2px; }

/* ---- CTA Button (Summary only) ---- */
.mltc-cta-row {
    text-align: center;
    padding: 18px 0 6px;
}
.mltc-cta-button {
    display: inline-block;
    padding: 12px 32px;
    background: #2d5f2d;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 5px;
    letter-spacing: 0.3px;
    transition: background 0.2s ease;
}
.mltc-cta-button:hover {
    background: #1e4a1e;
    color: #fff;
    text-decoration: none;
}

/* ---- Results Section ---- */
.mltc-results { padding: 0; }

.mltc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.mltc-table th,
.mltc-table td {
    padding: 10px 14px;
    text-align: right;
    border: 1px solid #d0d0d0;
}
.mltc-table th {
    font-weight: 700;
    font-size: 12px;
    vertical-align: bottom;
}

.mltc-col-label,
.mltc-row-label {
    text-align: left !important;
    font-weight: 500;
    white-space: normal;
}
.mltc-col-label { background: #f0f0f0; font-weight: 700; }

.mltc-header-green {
    background: #5c8d32;
    color: #fff;
    text-align: center !important;
    font-size: 12px;
}
.mltc-sub-header {
    background: #f0f0f0;
    font-size: 11px;
    text-align: center !important;
    line-height: 1.3;
}
.mltc-green-col { background: #f0f7e8 !important; font-weight: 600; }
.mltc-sub-header.mltc-green-col { background: #dcecc8 !important; color: #2d5f2d; font-weight: 700; }

.mltc-row-bold td { font-weight: 700; border-top: 2px solid #888; }

.mltc-val {
    white-space: nowrap;
    min-width: 100px;
    font-variant-numeric: tabular-nums;
    font-family: 'Segoe UI', monospace;
}

/* ---- Summary Section ---- */
.mltc-summary-section {
    padding: 16px 20px;
    border-top: 2px solid #5c8d32;
}
.mltc-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    margin-bottom: 6px;
    border-radius: 4px;
}
.mltc-summary-highlight { background: #e3fdcc; border: 1px solid #7ab648; }
.mltc-summary-label { font-weight: 700; font-size: 13px; flex: 1; padding-right: 16px; }
.mltc-summary-values { display: flex; gap: 16px; }
.mltc-summary-val {
    display: inline-block;
    min-width: 110px;
    text-align: right;
    font-weight: 700;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    padding: 4px 10px;
    border-radius: 3px;
}
.mltc-green-val { background: #5c8d32; color: #fff; }

/* ---- After-Tax Return ---- */
.mltc-return-section { padding: 14px 20px; border-top: 2px solid #c0c0c0; background: #f7f7f7; }
.mltc-return-row { display: flex; justify-content: space-between; align-items: center; }
.mltc-return-label { font-weight: 700; font-size: 14px; color: #333; }
.mltc-return-value {
    font-size: 20px;
    font-weight: 800;
    color: #2d5f2d;
    background: #e3fdcc;
    padding: 6px 20px;
    border-radius: 4px;
    border: 1px solid #7ab648;
}

/* ---- Disclaimer ---- */
.mltc-disclaimer { padding: 16px 24px; background: #fafafa; border-top: 1px solid #e0e0e0; }
.mltc-disclaimer p { font-size: 11px; color: #777; line-height: 1.6; }
.mltc-disclaimer a { color: #2d5f2d; text-decoration: underline; }

/* ---- Mobile Table Scroll ---- */
.mltc-table-scroll-wrap { position: relative; }
.mltc-table-scroll { position: relative; overflow: visible; }
.mltc-scroll-fade { display: none; }
.mltc-scroll-hint { display: none; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .mltc-wrap { font-size: 13px; }
    .mltc-title { font-size: 13px; padding: 12px 16px; }
    .mltc-inputs { padding: 16px; }
    .mltc-input-row { flex-wrap: wrap; gap: 4px; }
    .mltc-input-row label { flex: 1 1 100%; font-size: 12px; }
    .mltc-input-row select, .mltc-input-row input,
    .mltc-input-with-prefix, .mltc-display-value { flex: 1 1 100%; max-width: 100%; }

    .mltc-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        scrollbar-width: auto;
        scrollbar-color: #5c8d32 #e8f0e0;
    }
    .mltc-table-scroll::-webkit-scrollbar { height: 10px; }
    .mltc-table-scroll::-webkit-scrollbar-track { background: #e8f0e0; border-radius: 5px; }
    .mltc-table-scroll::-webkit-scrollbar-thumb { background: #5c8d32; border-radius: 5px; border: 2px solid #e8f0e0; }

    .mltc-scroll-fade {
        display: block; position: absolute; top: 0; right: 0; bottom: 10px; width: 40px;
        pointer-events: none; background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.9));
        z-index: 2; transition: opacity 0.3s ease;
    }
    .mltc-scroll-fade.mltc-fade-hidden { opacity: 0; }
    .mltc-scroll-hint {
        display: flex; align-items: center; justify-content: center; gap: 6px;
        padding: 7px 16px; margin: 0 16px; background: #5c8d32; color: #fff;
        font-size: 12px; font-weight: 600; border-radius: 0 0 8px 8px;
        animation: mltc-nudge 1.8s ease-in-out infinite;
        transition: opacity 0.4s ease, transform 0.4s ease;
    }
    .mltc-scroll-hint.mltc-hint-hidden { opacity: 0; transform: translateY(-6px); pointer-events: none; animation: none; }
    @keyframes mltc-nudge { 0%,100% { transform: translateX(0); } 50% { transform: translateX(6px); } }

    .mltc-table { font-size: 11px; min-width: 600px; }
    .mltc-table th, .mltc-table td { padding: 6px 6px; min-width: 70px; }
    .mltc-row-label { min-width: 120px !important; position: sticky; left: 0; background: #fff; z-index: 1; }
    .mltc-col-label { position: sticky; left: 0; z-index: 1; }
    .mltc-row-bold .mltc-row-label { background: #fff; }

    .mltc-summary-row { flex-wrap: wrap; gap: 8px; }
    .mltc-summary-label { flex: 1 1 100%; font-size: 12px; }
    .mltc-summary-values { flex: 1 1 100%; justify-content: flex-end; }
    .mltc-summary-val { font-size: 13px; min-width: 90px; }
    .mltc-return-row { flex-wrap: wrap; gap: 8px; }
    .mltc-return-label { font-size: 12px; }
    .mltc-return-value { font-size: 16px; padding: 4px 14px; }
}
