/**
 * Mutual Fund Calculator Styles
 * Japanese localized styles
 *
 * @package Zipper
 */

.mfc-hidden,
.mfc-waiting[hidden] {
    display: none !important;
}

#mfcCalculator {
    padding: 18px;
}

#mfcCalculator .tool-layout-split {
    grid-template-columns: 350px minmax(0, 1fr);
    margin-top: 0;
}

#mfcCalculator .tool-layout-input {
    gap: 8px;
}

#mfcResultCol {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.mfc-intro {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

.mfc-lead {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: #5f5a56;
}

.mfc-mode-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-top: 2px;
}

.mfc-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #e8e4dc;
    background: #faf9f7;
    color: #5f5a56;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.mfc-mode-badge i {
    color: #8a6500;
}

.mfc-mode-badge.is-accent {
    border-color: #eadfb8;
    background: linear-gradient(135deg, #fffaf0 0%, #f8f0d8 100%);
    color: #7a5d18;
    box-shadow: 0 3px 8px rgba(212, 175, 55, 0.10);
}

.mfc-mode-badge.is-accent i {
    color: #d4af37;
}

.mfc-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    transition: box-shadow 0.2s ease;
}

.mfc-section:hover {
    box-shadow: 0 2px 8px rgba(45, 42, 38, 0.1);
}

.mfc-input-section {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.mfc-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #2d2a26;
}

.mfc-section-title i,
.mfc-assumption-title i {
    color: #d4af37;
}

.mfc-input-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.mfc-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
    box-sizing: border-box;
}

.mfc-input-label {
    font-size: 12px;
    font-weight: 600;
    color: #5f5a56;
}

.mfc-inline-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
}

.mfc-money-input,
.mfc-number-input,
.mfc-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 14px;
    color: #2d2a26;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mfc-money-input {
    font-weight: 600;
    text-align: right;
}

.mfc-number-input {
    font-weight: 500;
    text-align: center;
}

.mfc-select {
    padding-right: 38px;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #8a6500 50%), linear-gradient(135deg, #8a6500 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 1px), calc(100% - 12px) calc(50% - 1px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.mfc-money-input:hover,
.mfc-number-input:hover,
.mfc-select:hover {
    border-color: #d4c67a;
}

.mfc-money-input:focus,
.mfc-number-input:focus,
.mfc-select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.mfc-money-input::placeholder,
.mfc-number-input::placeholder {
    color: #c4c0bc;
}

.mfc-unit-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    background: #faf9f7;
    color: #5f5a56;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.mfc-money-note,
.mfc-input-hint {
    font-size: 12px;
    line-height: 1.45;
    color: #7a756d;
}

.mfc-money-note {
    min-height: 16px;
    color: #b58300;
}

.mfc-assumption-box {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #eadfb8;
    background: #fffaf0;
}

.mfc-assumption-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #7a5d18;
}

.mfc-assumption-list,
.mfc-tip-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
    color: #5f5a56;
    font-size: 12px;
    line-height: 1.45;
}

.mfc-preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mfc-preset-btn {
    padding: 7px 12px;
    border: 1px solid #e8e4dc;
    border-radius: 999px;
    background: #fff;
    color: #5f5a56;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mfc-preset-btn:hover,
.mfc-preset-btn:focus-visible,
.mfc-preset-btn.is-active {
    outline: none;
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.12);
    color: #8a6500;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.14);
}

.mfc-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.mfc-btn-group .tool-btn {
    flex: 1 1 0;
    min-height: 40px;
    padding: 10px 12px;
    font-size: 13px;
    justify-content: center;
}

.tool-btn-excel {
    background: #59ab79;
    border-color: #59ab79;
}

.tool-btn-excel:hover,
.tool-btn-excel:focus-visible {
    background: #4f9f70;
    border-color: #4f9f70;
}

.mfc-waiting {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid #f1d0c8;
    border-radius: 12px;
    background: #fff7f5;
    color: #8a4331;
}

.mfc-waiting i {
    margin-top: 2px;
    color: #cb6f56;
}

.mfc-waiting p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.mfc-result-hero {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid #eadfb8;
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 45%, #fff 100%);
    box-shadow: 0 10px 24px rgba(212, 175, 55, 0.14);
}

.mfc-hero-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.mfc-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.mfc-status-badge.is-neutral {
    background: rgba(95, 90, 86, 0.08);
    color: #5f5a56;
}

.mfc-status-badge.is-ready {
    background: rgba(212, 175, 55, 0.16);
    color: #8a6500;
}

.mfc-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid #eadfb8;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: #8a6500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mfc-copy-btn:hover,
.mfc-copy-btn:focus-visible {
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.16);
}

.mfc-copy-btn:disabled,
.mfc-copy-btn[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

.mfc-hero-expression {
    font-size: 13px;
    font-weight: 700;
    color: #8a6500;
}

.mfc-hero-value {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: #2d2a26;
}

.mfc-hero-label {
    font-size: 12px;
    font-weight: 600;
    color: #7a756d;
}

.mfc-hero-summary {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #5f5a56;
}

.mfc-formula-box {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(212, 175, 55, 0.18);
    color: #5f5a56;
    font-size: 12px;
    line-height: 1.5;
}

.mfc-kpi-grid,
.mfc-composition-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}

.mfc-kpi-card,
.mfc-composition-card {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #e8e4dc;
    background: #fff;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.05);
    min-width: 0;
}

.mfc-kpi-label,
.mfc-composition-label {
    font-size: 12px;
    font-weight: 600;
    color: #7a756d;
}

.mfc-kpi-value,
.mfc-composition-value {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #2d2a26;
    word-break: keep-all;
}

.mfc-scenario-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}

.mfc-scenario-card {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid #e8e4dc;
    background: #fff;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.05);
}

.mfc-scenario-card.is-accent {
    border-color: #eadfb8;
    background: linear-gradient(135deg, #fffef8 0%, #fcf7ea 100%);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.12);
}

.mfc-scenario-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f5f3f0;
    color: #7a756d;
    font-size: 11px;
    font-weight: 700;
}

.mfc-scenario-card.is-accent .mfc-scenario-tag {
    background: rgba(212, 175, 55, 0.14);
    color: #8a6500;
}

.mfc-scenario-title {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
}

.mfc-scenario-value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #2d2a26;
}

.mfc-scenario-sub {
    font-size: 12px;
    line-height: 1.45;
    color: #7a756d;
}

.mfc-chart-wrap {
    position: relative;
    min-height: 260px;
    padding: 8px;
    border-radius: 14px;
    background: linear-gradient(180deg, #fff 0%, #faf9f7 100%);
    border: 1px solid #f0ece6;
}

.mfc-chart-wrap--compact {
    min-height: 240px;
}

.mfc-chart-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    margin: 0;
    padding: 18px;
    text-align: center;
    border-radius: 12px;
    border: 1px dashed #e2d6b2;
    background: #fffdf8;
    color: #7a756d;
    font-size: 13px;
    line-height: 1.6;
}

.mfc-schedule-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.mfc-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.mfc-download-btn i {
    font-size: 13px;
}

.mfc-calculate-btn {
    color: #6a5200;
    background: linear-gradient(135deg, #f9efbf 0%, #ecd06a 100%);
    border: 1px solid #e0c05a;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.16);
}

.mfc-calculate-btn:hover,
.mfc-calculate-btn:focus-visible {
    color: #594500;
    background: linear-gradient(135deg, #f6e69f 0%, #e3c04f 100%);
    border-color: #d8b246;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.18);
}

.mfc-calculate-btn i {
    font-size: 14px;
}

.mfc-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.mfc-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 13px;
}

.mfc-table th,
.mfc-table td {
    padding: 11px 10px;
    border-bottom: 1px solid #eee7dc;
    text-align: right;
    white-space: nowrap;
}

.mfc-table th:first-child,
.mfc-table td:first-child {
    text-align: center;
}

.mfc-table th {
    font-size: 12px;
    font-weight: 700;
    color: #7a756d;
    background: #faf9f7;
}

.mfc-table tbody tr:nth-child(even) {
    background: rgba(250, 249, 247, 0.7);
}

.mfc-table tbody tr:hover {
    background: rgba(212, 175, 55, 0.08);
}

.mfc-disclaimer {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid #eee7dc;
    background: #faf9f7;
    color: #7a756d;
    font-size: 12px;
    line-height: 1.5;
}

.mfc-disclaimer i {
    color: #d4af37;
    margin-top: 2px;
}

.mfc-tip-section {
    position: relative;
}

#mfcCalculator .tool-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 900px) {
    #mfcCalculator .tool-layout-split {
        grid-template-columns: 1fr;
    }

    #mfcCalculator .tool-layout-input {
        max-width: 100%;
        overflow: hidden;
    }

    .mfc-input-row,
    .mfc-scenario-grid {
        grid-template-columns: 1fr;
    }

    .mfc-money-input:not([type="radio"]):not([type="checkbox"]),
    .mfc-number-input:not([type="radio"]):not([type="checkbox"]),
    .mfc-select {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 640px) {
    #mfcCalculator {
        padding: 16px 14px;
    }

    .mfc-kpi-grid,
    .mfc-composition-grid {
        grid-template-columns: 1fr;
    }

    .mfc-btn-group .tool-btn {
        min-width: 0;
    }

    .mfc-hero-value {
        font-size: 30px;
    }

    .mfc-download-btn {
        min-height: 32px;
        padding: 6px 9px;
        font-size: 11px;
    }

    .mfc-table {
        min-width: 700px;
    }
}

@media (max-width: 480px) {
    #mfcCalculator,
    #mfcCalculator .tool-layout-split,
    #mfcCalculator .tool-layout-input,
    #mfcResultCol,
    .mfc-section,
    .mfc-result-hero {
        max-width: 100%;
        overflow-x: hidden;
    }

    .mfc-inline-input {
        grid-template-columns: minmax(0, 1fr);
    }

    .mfc-unit-chip {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mfc-section,
    .mfc-money-input,
    .mfc-number-input,
    .mfc-select,
    .mfc-preset-btn,
    .mfc-copy-btn {
        transition: none !important;
    }

    .mfc-section:hover,
    .mfc-preset-btn:hover,
    .mfc-copy-btn:hover {
        transform: none !important;
    }
}
