/* 帯分数計算デモ - WordPress プラグイン用スタイル */

.mfc-wrapper {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f7fb;
    color: #111827;
    position: relative;
}

/* ヘッダー部分 */
.mfc-header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    margin-bottom: 20px;
    border-radius: 8px;
}

.mfc-headerTop {
    padding: 12px 20px;
    border-bottom: 2px solid #e5e7eb;
}

.mfc-topRow {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.mfc-title {
    margin: 0;
    font-size: 28px;
    letter-spacing: .02em;
}

.mfc-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* 共通トグルエリア */
.mfc-commonToggles {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 16px;
    background: #f3f4f6;
    border-radius: 12px;
}

/* タブナビゲーション */
.mfc-tabNavigation {
    padding: 0 20px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.mfc-tabButton {
    flex-shrink: 0;
    padding: 16px 32px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.mfc-tabButton:hover {
    color: #2563eb;
    background: #f3f4f6;
}

.mfc-tabButton.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: #eff6ff;
}

/* 解説トグルボタン */
.mfc-explainToggleGroup {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 6px 14px;
    background: #ffffff;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    transition: all 0.2s;
}

.mfc-explainToggleGroup.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.mfc-explainToggle {
    position: relative;
    width: 44px;
    height: 22px;
    background: #9ca3af;
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.3s;
}

.mfc-explainToggle.disabled {
    cursor: not-allowed;
}

.mfc-explainToggle.active {
    background: #10b981;
}

.mfc-toggleKnob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mfc-explainToggle.active .mfc-toggleKnob {
    transform: translateX(22px);
}

.mfc-explainLabel {
    font-size: 14px;
    color: #6b7280;
    white-space: nowrap;
    font-weight: 700;
}

.mfc-explainToggle.active + .mfc-explainLabel {
    color: #10b981;
}

.mfc-btn {
    border: 0;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 4px 10px rgba(37,99,235,.2);
    transition: all 0.2s;
}

.mfc-btn:hover {
    filter: brightness(0.95);
}

.mfc-btn:active {
    transform: translateY(1px);
}

.mfc-btn-ghost {
    background: #e5e7eb !important;
    color: #111827 !important;
    box-shadow: none !important;
}

.mfc-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

/* メインコンテンツエリア */
.mfc-mainContent {
    padding: 20px;
}

.mfc-problemCard {
    border: 3px solid #e5e7eb;
    border-radius: 16px;
    padding: 60px;
    margin-bottom: 20px;
    background: #ffffff;
}

.mfc-label {
    font-size: 32px;
    font-weight: 800;
    color: #374151;
    margin-bottom: 30px;
}

.mfc-problemLine {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
    justify-content: center;
    font-size: 96px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: .02em;
    min-height: 160px;
}

.mfc-opBadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    height: 100px;
    padding: 0 24px;
    border-radius: 24px;
    background: #111827;
    color: #fff;
    font-size: 72px;
    font-weight: 900;
}

.mfc-fractionDisplay {
    display: inline-flex;
    align-items: center;
    gap: 20px;
}

.mfc-mixedInt {
    font-size: 96px;
    font-weight: 900;
}

.mfc-frac {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 140px;
}

.mfc-fracTop, .mfc-fracBottom {
    font-size: 72px;
    font-weight: 900;
    line-height: 1.05;
}

.mfc-bar {
    width: 160px;
    height: 8px;
    background: #111827;
    margin: 10px 0;
    border-radius: 999px;
}

.mfc-infoRow {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.mfc-pill {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    padding: 12px 16px;
    border-radius: 999px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    font-size: 20px;
    font-weight: 800;
    color: #111827;
}

.mfc-note {
    font-size: 16px;
    color: #6b7280;
    margin-top: 10px;
    text-align: center;
}

/* 全画面ポップアップオーバーレイ */
.mfc-fullscreenOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mfc-fullscreenOverlay.active {
    display: flex;
    opacity: 1;
}

/* ポップアップ手順カード（全画面） */
.mfc-stepItem {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #ffffff;
    border: 6px solid #2563eb;
    border-radius: 24px;
    padding: 60px;
    width: 90vw;
    max-width: 1400px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 30px 100px rgba(0,0,0,.5);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mfc-stepItem.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.mfc-stepItem.exit-left {
    animation: mfc-exitLeft 0.4s forwards;
}

.mfc-stepItem.exit-right {
    animation: mfc-exitRight 0.4s forwards;
}

@keyframes mfc-exitLeft {
    to {
        opacity: 0;
        transform: translate(-120%, -50%) scale(0.8);
    }
}

@keyframes mfc-exitRight {
    to {
        opacity: 0;
        transform: translate(20%, -50%) scale(0.8);
    }
}

.mfc-stepItem .mfc-eq {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    font-weight: 900;
    line-height: 1.2;
    width: 100%;
}

/* ポップアップ内の分数表示を特大に */
.mfc-stepItem .mfc-mixedInt {
    font-size: 80px;
}

.mfc-stepItem .mfc-frac {
    min-width: 120px;
}

.mfc-stepItem .mfc-fracTop,
.mfc-stepItem .mfc-fracBottom {
    font-size: 64px;
}

.mfc-stepItem .mfc-bar {
    width: 140px;
    height: 6px;
    margin: 8px 0;
}

.mfc-stepItem .mfc-opBadge {
    min-width: 100px;
    height: 80px;
    font-size: 56px;
    border-radius: 20px;
}

/* 解説用のチップスタイル */
.mfc-stepItem .mfc-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 700;
    text-align: center;
    background: #dbeafe;
    color: #1e40af;
    border: 2px solid #3b82f6;
    font-size: 48px;
    margin: 0 8px;
}

.mfc-stepItem .mfc-chip.common {
    background: #dcfce7;
    color: #166534;
    border-color: #22c55e;
}

/* 2列比較レイアウト */
.mfc-compareLayout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    width: 100%;
}

.mfc-compareColumn {
    text-align: center;
}

.mfc-compareColumn h3 {
    font-size: 48px;
    margin: 0 0 20px 0;
    color: #2563eb;
}

/* ステップナビゲーション（左右に配置） */
.mfc-stepNavigationLeft, .mfc-stepNavigationRight {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    flex-direction: column;
    gap: 20px;
    z-index: 1000000;
}

.mfc-stepNavigationLeft {
    left: 40px;
}

.mfc-stepNavigationRight {
    right: 40px;
}

.mfc-fullscreenOverlay.active ~ .mfc-stepNavigationLeft,
.mfc-fullscreenOverlay.active ~ .mfc-stepNavigationRight {
    display: flex;
}

.mfc-navButton {
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid #2563eb;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 32px;
    font-weight: 900;
    color: #2563eb;
    transition: all 0.2s;
    box-shadow: 0 8px 24px rgba(37,99,235,.3);
}

.mfc-navButton:hover {
    background: #2563eb;
    color: white;
    transform: scale(1.1);
}

.mfc-navButton.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: scale(1);
}

/* ステップカウンター（全画面時） */
.mfc-stepCounter {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #2563eb;
    padding: 16px 28px;
    border-radius: 999px;
    font-size: 28px;
    font-weight: 900;
    z-index: 1000000;
    display: none;
    border: 3px solid #2563eb;
    box-shadow: 0 8px 24px rgba(37,99,235,.3);
}

.mfc-fullscreenOverlay.active ~ .mfc-stepCounter {
    display: block;
}

/* 閉じるボタン（全画面時） */
.mfc-closeButton {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid #ef4444;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 32px;
    font-weight: 900;
    color: #ef4444;
    z-index: 1000000;
    transition: all 0.2s;
    box-shadow: 0 8px 24px rgba(239,68,68,.3);
}

.mfc-closeButton:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

.mfc-fullscreenOverlay.active ~ .mfc-closeButton {
    display: flex;
}

/* インジケーター（全画面時） */
.mfc-stepIndicator {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 12px;
    z-index: 1000000;
}

.mfc-fullscreenOverlay.active ~ .mfc-stepIndicator {
    display: flex;
}

.mfc-stepDot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.mfc-stepDot.active {
    background: #2563eb;
    width: 48px;
    border-radius: 8px;
    border-color: #2563eb;
}

.mfc-stepDot:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.2);
}

/* 手順開始ボタン */
.mfc-btn-start {
    background: #10b981 !important;
    box-shadow: 0 6px 16px rgba(16,185,129,.3) !important;
}

.mfc-btn-start:hover {
    filter: brightness(1.1) !important;
}
