/* 最適検索ページ用スタイル */
:root {
    --accent-color: #4da6ff;
    /* 青系アクセント (optimal search theme) */
}


/* メインカード */
.optimal-search-card {
    padding: 20px;
    background: rgba(20, 20, 30, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 必須スキル追加ボタン */
.add-skill-btn {
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

@media (hover: hover) {
    .add-skill-btn:hover {
        background-color: rgba(255, 255, 255, 0.08);
        border-color: var(--accent-color);
        color: var(--accent-color);
    }
}

/* スキル行 */
.opt-skill-row {
    display: flex;
    /* Flexboxで横並び */
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease;
    flex-wrap: nowrap;
    /* 折り返しを禁止 */
    width: 100%;
    box-sizing: border-box;
    /* パディングを含める */
}

.opt-skill-select {
    flex: 1 1 auto;
    /* 伸縮可能 */
    min-width: 0;
    /* 縮小可能にするために必須 */
    /* テキストが長い場合に省略 */
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    /* 幅確保 */
    width: 100px;
    /* ベース幅 */
    padding: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-dark);
    color: var(--text-main);
    border-radius: 6px;
}

.opt-skill-select:focus {
    border-color: var(--accent-color);
    outline: none;
}

/* レベル選択プルダウン */
.opt-level-select {
    flex: 0 0 75px;
    /* 固定幅 */
    width: 75px;
    min-width: 75px;
    padding: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-dark);
    color: var(--text-main);
    border-radius: 6px;
}

/* 削除ボタン */
.opt-remove-skill-btn {
    flex: 0 0 32px;
    /* 固定幅 */
    width: 32px;
    height: 32px;
    background-color: rgba(255, 68, 68, 0.2);
    border: 1px solid rgba(255, 68, 68, 0.5);
    border-radius: 6px;
    /* 角丸四角形 */
    color: #ffcccc;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

@media (hover: hover) {
    .opt-remove-skill-btn:hover {
        background-color: rgba(255, 68, 68, 0.4);
        color: #ffffff;
        border-color: #ff4444;
    }
}

/* カラムタイトル */
.column-title {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 12px;
    border-left: 3px solid var(--accent-color);
    padding-left: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-icon {
    font-size: 1.1rem;
}

/* 実行ボタンコンテナ */
.optimal-action-container {
    margin-top: 30px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.optimal-search-btn {
    background: linear-gradient(135deg, var(--accent-color), #4050ff);
    color: white;
    border: none;
    padding: 12px 60px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(58, 123, 213, 0.3);
    transition: all 0.2s ease;
}

@media (hover: hover) {
    .optimal-search-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(58, 123, 213, 0.5);
    }
}

.optimal-search-btn:active {
    transform: translateY(1px);
}

/* モーダルスタイル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1001;
    /* Above .bottom-nav (z-index: 1000) */
    display: flex;
    align-items: flex-start;
    /* 上部に配置 */
    justify-content: center;
    padding-top: 40px;
    /* 上部から少し空ける */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-sizing: border-box;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.search-modal {
    background-color: #1a1a24;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.progress-label {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg,
            var(--accent-color) 0%,
            #4050ff 50%,
            var(--accent-color) 100%);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.2s linear;
    animation: progressShimmer 1.5s ease-in-out infinite;
}

/* プログレスバーアニメーション: 処理中を視覚化 */
@keyframes progressShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.status-text-box {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    height: 150px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.9rem;
    color: #a0a0b0;
    white-space: pre-wrap;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.modal-btn {
    padding: 8px 20px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-main);
    cursor: pointer;
    transition: background-color 0.2s;
}

@media (hover: hover) {
    .modal-btn:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

.modal-btn.danger {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.3);
}

@media (hover: hover) {
    .modal-btn.danger:hover {
        background-color: rgba(255, 107, 107, 0.1);
    }
}

/* PCレイアウト (768px以上) */
@media (min-width: 768px) {
    .optimal-grid-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px;
        margin-top: 15px;
    }

    .optimal-basic-settings {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 20px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}