/* menu_admin.css - メニュー管理画面固有スタイル（admin-common.cssと併用） */

/* ==================== カテゴリグループ ==================== */
.category-group {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.category-group-header {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(255, 107, 53, 0.05));
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.category-group-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-group-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.category-group-items {
    padding: 0.75rem;
    min-height: 60px;
}

.category-group-items.drag-over-zone {
    background: rgba(74, 222, 128, 0.1);
}

/* ==================== ソート可能リスト ==================== */
.sortable-list {
    list-style: none;
}

.sortable-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.sortable-item:last-child {
    margin-bottom: 0;
}

.sortable-item.dragging {
    opacity: 0.5;
    border-color: var(--accent);
}

.drag-handle {
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: grab;
}

.sortable-item-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.sortable-item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sortable-item-name {
    font-weight: 600;
}

.price-badge {
    color: var(--accent);
    font-weight: 700;
}

/* ==================== ステータストグル ==================== */
.status-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--bg-primary);
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.status-toggle.active {
    background: var(--success);
}

.status-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s;
}

.status-toggle.active::after {
    left: 25px;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ==================== オプション設定 ==================== */
.options-section {
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.options-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.option-group-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.option-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.option-group-name {
    font-weight: 600;
}

.option-group-type {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-primary);
    border-radius: 4px;
    color: var(--text-secondary);
}

.option-items-list {
    margin-top: 0.5rem;
}

.option-item-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 0.25rem;
}

.option-item-row input {
    flex: 1;
}

.option-item-row .price-input {
    width: 80px;
}

.option-item-default {
    width: 24px;
    height: 24px;
}

.add-option-btn {
    margin-top: 0.5rem;
}

/* ==================== リンク済みオプションタグ ==================== */
.linked-options-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.linked-option-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--info);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
}

/* ==================== 空カテゴリ ==================== */
.empty-category {
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem;
    text-align: center;
}

/* ==================== インポート/エクスポート ==================== */
.import-section {
    margin-bottom: 1.5rem;
}

.import-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.export-section {
    padding: 1rem 0;
}

.menu-count {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* プリセットグリッド */
.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.preset-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.preset-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.preset-card.loading {
    pointer-events: none;
    opacity: 0.7;
}

.preset-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.preset-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.preset-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ファイルアップロードエリア */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-secondary);
}

.file-upload-area:hover {
    border-color: var(--accent);
    background: rgba(255, 107, 53, 0.05);
}

.file-upload-area.drag-over {
    border-color: var(--accent);
    background: rgba(255, 107, 53, 0.1);
}

.file-upload-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.file-upload-area p {
    color: var(--text-secondary);
    margin: 0;
}

.file-name {
    margin-top: 0.5rem !important;
    font-weight: 600;
    color: var(--accent) !important;
}

/* インポート結果 */
.import-result {
    padding: 1rem;
    border-radius: 12px;
    background: var(--bg-secondary);
}

.import-result.success {
    border-left: 4px solid var(--success);
}

.import-result.error {
    border-left: 4px solid var(--danger);
}

.import-result h4 {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.import-result.success h4 {
    color: var(--success);
}

.import-result.error h4 {
    color: var(--danger);
}

.import-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.import-stat {
    font-size: 0.9rem;
}

.import-stat strong {
    color: var(--text-primary);
}

.import-errors {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    font-size: 0.85rem;
}

.import-errors h5 {
    color: var(--danger);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.import-errors ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-secondary);
}

.import-errors li {
    margin-bottom: 0.25rem;
}

/* フォーマット情報 */
.format-info {
    padding: 0.5rem 0;
}

.format-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.format-table th,
.format-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.format-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.format-table code {
    background: var(--bg-primary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    color: var(--accent);
}

.csv-example {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
}

.csv-example h4 {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.csv-example pre {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

/* ボタン追加スタイル */
.btn-block {
    width: 100%;
}

/* 確認ダイアログ */
.confirm-dialog {
    text-align: center;
    padding: 1rem;
}

.confirm-dialog-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.confirm-dialog-message {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.confirm-dialog-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ローディングスピナー */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
