/* メニュー画面のページスタイル */

/* 全体レイアウト */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* ヘッダー */
.header-wrapper {
    flex: 0 0 auto;
    min-height: 56px;
    position: relative;
    z-index: 100;
}

.menu-header {
    background: #e3276a;
    color: white;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
    box-sizing: border-box;
    position: relative;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: white;
    flex: 1;
    text-align: center;
}

.header-left, .header-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    width: 50px;
}

/* メインコンテンツ */
.menu-main-container {
    flex: 1;
    background: #f8f9fa;
    overflow-y: auto;
    padding: 20px 15px;
    -webkit-overflow-scrolling: touch;
}

.menu-content-card {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* アコーディオン改善 */
.accordion-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px !important;
    margin-bottom: 12px;
    overflow: hidden;
}

.accordion-button {
    background: white;
    color: #333;
    font-weight: 500;
    font-size: 15px;
    padding: 14px 16px;
    border: none;
    box-shadow: none !important;
    position: relative;
    transition: all 0.2s;
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, #ED5589 0%, #ff7ba3 100%);
    color: white;
}

.accordion-button:hover {
    background: #f8f9fa;
}

.accordion-button:not(.collapsed):hover {
    background: linear-gradient(135deg, #e04478 0%, #ff6b95 100%);
}

/* 全セット完了時のアコーディオンヘッダー */
.accordion-button.all-sets-complete {
    background: linear-gradient(135deg, #28a745 0%, #5cb85c 100%) !important;
    color: white !important;
    position: relative;
    overflow: hidden;
}

/* 完了アイコンを追加 */
.accordion-button.all-sets-complete::before {
    content: '✓';
    position: absolute;
    right: 50px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: completePulse 2s infinite;
}

@keyframes completePulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* 展開時かつ完了時 */
.accordion-button.all-sets-complete:not(.collapsed) {
    background: linear-gradient(135deg, #218838 0%, #28a745 100%) !important;
}

/* ホバー時 */
.accordion-button.all-sets-complete:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #218838 100%) !important;
}

/* アイコンの色も調整 */
.accordion-button.all-sets-complete .menu-icon {
    filter: brightness(0) invert(1);
}

.accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236c757d'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    transform: rotate(180deg);
}

.menu-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.accordion-button:not(.collapsed) .menu-icon {
    filter: brightness(0) invert(1);
}

.accordion-body {
    padding: 16px;
    background: #fafbfc;
}

/* メニューテーブル改善 */
.menu-table {
    width: 100%;
    margin: 16px 0;
    table-layout: auto;
}

.menu-table tbody {
    display: table;
    width: 100%;
}

.menu-table tr.setData {
    display: table-row;
}

.menu-table td {
    padding: 10px 6px;
    vertical-align: middle !important;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.menu-table tr:last-child td {
    border-bottom: none;
}

.menu-input {
    width: 70px;
    height: 34px;
    padding: 6px 4px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    transition: all 0.2s;
    vertical-align: middle;
    display: inline-block;
    line-height: normal;
}

.menu-input:focus {
    outline: none;
    border-color: #e3276a;
    box-shadow: 0 0 0 2px rgba(227, 39, 106, 0.1);
}

/* 単位表示 */
.w_unit {
    margin-left: 4px;
    color: #6c757d;
    font-size: 13px;
}

/* 距離・時間ラベル（ラン等） */
.distance-time-label {
    display: inline-block;
    padding: 6px 12px;
    background: #e3f2fd;
    border-radius: 8px;
    font-size: 14px;
    color: #1976d2;
    margin-bottom: 8px;
}

/* ボタン改善 */
.guideBtn {
    background: linear-gradient(135deg, #ED5589 0%, #ff7ba3 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(237, 85, 137, 0.2);
}

.guideBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 85, 137, 0.3);
    background: linear-gradient(135deg, #e04478 0%, #ff6b95 100%);
}

.setBtn {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* セット追加ボタン - メインカラー */
.setBtnPlus {
    background: linear-gradient(135deg, #ED5589 0%, #ff7ba3 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(237, 85, 137, 0.2);
}

.setBtnPlus:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 85, 137, 0.3);
    background: linear-gradient(135deg, #e04478 0%, #ff6b95 100%);
}

/* 削除ボタン - グレーアウトスタイル */
.menuBtnMinus {
    background: white;
    color: #6c757d;
    border: 2px solid #dee2e6;
    box-shadow: none;
}

.menuBtnMinus:hover {
    border-color: #dc3545;
    color: #dc3545;
    background: #fff5f5;
    transform: translateY(-1px);
}

/* 種目追加ボタン - アコーディオンと同じスタイル */
.menuBtnPlus {
    background: white;
    color: #333;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 14px 20px;
    width: 100%;
    margin-top: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.menuBtnPlus:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.setBtnPlus:active,
.menuBtnMinus:active,
.menuBtnPlus:active {
    transform: translateY(0);
}

/* 完了チェックボックス（セット達成用） - 丸いデザイン */
.option-input.execution {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 30px !important;
    height: 30px !important;
    background: #fff !important;
    border: 2.5px solid #dee2e6 !important;
    border-radius: 50% !important;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    margin: 0;
    vertical-align: middle;
    flex-shrink: 0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* beforeを無効化 */
.option-input.execution::before {
    content: none !important;
    display: none !important;
}

/* 未完了状態のホバー */
.option-input.execution:not(:checked):hover {
    border-color: #28a745 !important;
    background: #fff !important;
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.15);
}

/* 完了状態 - 緑色で成功を表現 */
.option-input.execution:checked {
    background: #28a745 !important;
    border-color: #28a745 !important;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.25);
    animation: checkPulse 0.4s ease;
    border-radius: 50% !important;
}

/* チェック時もbeforeを無効化 */
.option-input.execution:checked::before {
    content: none !important;
    display: none !important;
}

/* チェック時のアニメーション */
@keyframes checkPulse {
    0% { transform: scale(1); }
    30% { transform: scale(0.9); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* チェックマーク */
.option-input.execution:checked::after {
    content: '✓' !important;
    position: absolute !important;
    color: white !important;
    font-size: 18px !important;
    font-weight: bold !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    animation: checkmarkFade 0.3s ease;
    background: transparent !important;
    border: none !important;
    width: auto !important;
    height: auto !important;
}

@keyframes checkmarkFade {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* 完了状態のホバー */
.option-input.execution:checked:hover {
    background: #218838 !important;
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.35);
}

/* オプション: テキスト付きスタイル（将来的な拡張用） */
.execution-with-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    background: #f8f9fa;
    transition: all 0.2s;
}

.execution-with-label:has(.option-input.execution:checked) {
    background: #d4edda;
}

.execution-label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.2s;
}

.execution-with-label:has(.option-input.execution:checked) .execution-label {
    color: #28a745;
}

/* 自重・チューブ用チェックボックス（四角） */
.option-input.checkbox:not(.execution) {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 4px !important;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    margin-right: 6px;
    vertical-align: middle;
}

.option-input.checkbox:not(.execution):checked {
    background: #ED5589;
    border-color: #ED5589;
    border-radius: 4px !important;
}

.option-input.checkbox:not(.execution):checked::before {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    font-weight: bold;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* チェックボックスのラベル */
.dpx {
    display: flex;
    align-items: center;
    justify-content: center;
}

.px label {
    display: flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
}

/* テーブルセルの幅設定 */
.menu-table td:first-child {
    width: 50px;
    text-align: center;
}

.menu-table td:nth-child(2) {
    width: 120px;
}

.menu-table td:nth-child(3) {
    width: 100px;
}

.menu-table td:last-child {
    width: 60px;
    text-align: center;
}

/* 自重・チューブの統一表示 */
.weight-type-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 12px;
    font-weight: 600;
    color: white;
    margin-right: 4px;
}

.weight-type-badge.ownweight {
    background: linear-gradient(135deg, #e3276a 0%, #f06292 100%);
}

.weight-type-badge.tube {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
}

/* ヘッダー内タイマー表示 */
.time-wrap-header {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    padding: 0 20px;
}

.progress-time-header-container {
    background: linear-gradient(135deg, #ED5589 0%, #ff7ba3 100%);
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-time-header {
    font-size: 20px;
    font-weight: 600;
    color: white;
    letter-spacing: 1px;
}

.stop-btn-header {
    position: absolute;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.stop-btn-header:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* メニュー完了ボタン - キーカラー */
.menu-complete-btn {
    background: linear-gradient(135deg, #ED5589 0%, #ff7ba3 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    margin-top: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(237, 85, 137, 0.2);
}

.menu-complete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(237, 85, 137, 0.3);
    background: linear-gradient(135deg, #e04478 0%, #ff6b95 100%);
}

.menu-complete-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(237, 85, 137, 0.2);
}

/* 開始画面のスタイル */
.start-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 40px 20px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

#bgVideo {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
    pointer-events: none;
}

/* 確認モーダルのスタイル */
.confirm-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.confirm-inner {
    background: white;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  padding: 0 !important;
}

.confirm-header {
    padding: 20px;
    background: linear-gradient(135deg, #ED5589 0%, #ff7ba3 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.confirm-body {
    padding: 30px 20px;
    text-align: center;
    background: #f8f9fa;
}

.confirm-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    display: inline-block;
}

.confirm-body p {
    margin: 0;
}

footer {
  background: none;
  background-color: transparent;
}

.confirm-footer {
    padding: 15px 20px;
    background: none;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.confirm-ok-btn {
    background: #ED5589;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
  width: 100%;
}

.confirm-ok-btn:hover {
    background: #e04478;
    transform: translateY(-1px);
}

.confirm-no-btn {
    background: white;
    color: #6c757d;
    border: 1px solid #dee2e6;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
  width: 100%;
}

.confirm-no-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

/* セット番号をクリック可能に */
.setNum {
    cursor: pointer;
    background: #f8f9fa;
    color: #6c757d;
    padding: 8px 10px;
    border-radius: 8px;
    transition: all 0.2s;
    display: inline-block;
    min-width: 35px;
    text-align: center;
    font-weight: 600;
    position: relative;
    line-height: 1;
    vertical-align: middle;
}

.setNum:hover {
    background: linear-gradient(135deg, #fff5f8 0%, #ffe0e9 100%);
    color: #ED5589;
    transform: scale(1.05);
}

.setNum:hover::after {
    content: 'EDIT';
    position: absolute;
    right: -35px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.8;
    font-weight: bold;
    color: #ED5589;
}

/* トレーニング完了メッセージ */
.completion-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.completion-inner {
    background: white;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    padding: 40px;
    text-align: center;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.completion-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.checkmark {
    width: 80px;
    height: 80px;
    stroke-width: 2;
    stroke: #28a745;
    stroke-miterlimit: 10;
    animation: checkmarkScale 0.3s ease-in-out 0.3s both;
}

@keyframes checkmarkScale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke: #28a745;
    animation: checkmarkStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: checkmarkStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.3s forwards;
}

@keyframes checkmarkStroke {
    100% {
        stroke-dashoffset: 0;
    }
}

.completion-title {
    color: #333;
    font-size: 28px;
    font-weight: bold;
    margin: 20px 0 10px;
    animation: fadeInUp 0.5s ease 0.5s both;
}

.completion-subtitle {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
    animation: fadeInUp 0.5s ease 0.6s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.completion-stats {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    animation: fadeInUp 0.5s ease 0.7s both;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.stat-value {
    color: #ED5589;
    font-size: 24px;
    font-weight: bold;
}

.completion-btn {
    background: linear-gradient(135deg, #ED5589 0%, #ff7ba3 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease 0.8s both;
}

.completion-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(237, 85, 137, 0.3);
}

/* プロフィール完成画面のスタイル */
.profile-welcome-title {
    color: #ED5589;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

.profile-welcome-subtitle {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
    text-align: center;
}

.profile-section {
    margin-bottom: 25px;
}

.profile-section-title {
    font-size: 14px;
    font-weight: bold;
    color: #666;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ED5589;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .accordion-body {
        padding: 12px;
    }
    
    .accordion-button {
        padding: 12px;
        font-size: 14px;
    }
    
    .menu-main-container {
        padding: 12px 10px;
    }
    
    .menu-content-card {
        padding: 15px;
        border-radius: 10px;
    }
    
    .menu-input {
        width: 60px;
        height: 32px;
        font-size: 13px;
    }
    
    .setBtn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .guideBtn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .menu-table td {
        padding: 8px 4px;
        font-size: 14px;
    }
    
    .accordion-item {
        margin-bottom: 10px;
    }
    
    .equipment-info {
        padding: 8px 10px;
    }
    
    .w_unit {
        font-size: 12px;
    }
    
    .distance-time-label {
        padding: 4px 8px;
        font-size: 12px;
    }
}