/* メニュー画面のモーダル関連スタイル */

/* セット編集モーダル背景 */
.set-edit-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out;
}

.set-edit-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* セット編集モーダル本体 */
.set-edit-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    max-height: 85vh;
    background: white;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.15);
}

.set-edit-modal.show {
    transform: translateY(0);
}

.set-edit-header {
    padding: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    flex-shrink: 0;
}

.set-edit-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.set-edit-close-btn:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.set-edit-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.set-edit-subtitle {
    font-size: 14px;
    color: #666;
}

.set-edit-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.set-edit-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* セットオプションボタン */
.set-option-btn {
    padding: 18px;
    padding-left: 50px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    position: relative;
    overflow: hidden;
    color: #6c757d;
}

.set-option-btn:hover {
    border-color: #adb5bd;
    background: #f8f9fa;
}

/* 未選択状態のラジオボタン */
.set-option-btn::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    background: white;
}

/* 選択状態の共通スタイル */
.set-option-btn[data-selected="true"] {
    font-weight: 600;
}

.set-option-btn[data-selected="true"]::before {
    border-color: #007bff;
}

.set-option-btn[data-selected="true"]::after {
    content: '';
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #007bff;
}

/* 自重選択時のスタイル */
.set-option-btn.ownweight[data-selected="true"] {
    background: linear-gradient(135deg, #fff5f8 0%, #ffe0e9 100%);
    border-color: #e3276a;
    color: #e3276a;
}

.set-option-btn.ownweight[data-selected="true"]::before {
    border-color: #e3276a;
}

.set-option-btn.ownweight[data-selected="true"]::after {
    background: #e3276a;
}

/* チューブ選択時のスタイル */
.set-option-btn.tube[data-selected="true"] {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #4CAF50;
    color: #4CAF50;
}

.set-option-btn.tube[data-selected="true"]::before {
    border-color: #4CAF50;
}

.set-option-btn.tube[data-selected="true"]::after {
    background: #4CAF50;
}

/* 重量入力グループ */
.set-weight-input-group {
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    transition: all 0.2s;
    cursor: pointer;
}

.set-weight-input-group:hover {
    border-color: #adb5bd;
    background: #f8f9fa;
}

/* 重量入力が選択されている状態 */
.set-weight-input-group.selected {
    border-color: #007bff;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.set-weight-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    display: block;
}

.set-weight-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.set-weight-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.set-weight-unit {
    font-size: 16px;
    color: #666;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 30px;
}

/* フッター */
.set-edit-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
    background: white;
}

.set-edit-cancel,
.set-edit-confirm {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.set-edit-cancel {
    background: #f5f5f5;
    color: #666;
}

.set-edit-cancel:hover {
    background: #e0e0e0;
}

.set-edit-confirm {
    background: linear-gradient(135deg, #e3276a 0%, #f06292 100%);
    color: white;
}

.set-edit-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(227,39,106,0.3);
}

/* 種目追加モーダル背景 */
.menu-add-backdrop,
#eventAddBg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9997;
    display: none;
    opacity: 0;
    transition: opacity 0.1s ease-out;
}

#eventAddBg[style*="display: block"] {
    display: block !important;
    opacity: 1;
}

/* 種目追加モーダル本体 */
.menu-add-modal,
#eventAdd {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 50vh;
    max-height: 95vh;
    background: white;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.15s ease-out;
    z-index: 9998;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.15);
    will-change: transform;
}

#eventAdd.show {
    transform: translateY(0);
    height: 85vh;
}

.menu-add-header {
    padding: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    flex-shrink: 0;
}

.menu-add-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.menu-add-close-btn:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.menu-add-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.menu-add-subtitle {
    font-size: 14px;
    color: #666;
}

.menu-add-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
    min-height: 300px;
}

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

.menuModalList li {
    padding: 16px 20px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    color: #333;
    border: 2px solid transparent;
}

.menuModalList li:hover {
    background: #e8f5e9;
    border-color: #4CAF50;
    transform: translateX(4px);
}

.menuModalList li:active {
    transform: scale(0.98);
}

/* モバイル対応 */
@media (max-width: 768px) {
    .set-edit-modal,
    .menu-add-modal,
    #eventAdd {
        max-height: 90vh;
    }
    
    .set-edit-body,
    .menu-add-body {
        padding: 16px;
    }
    
    .set-edit-footer {
        padding: 16px;
    }
}