/**
 * マクロ検索機能用CSS (シンプル・グレーベース版)
 * macro-search.js と組み合わせて使用
 */

/* 検索ボタンのスタイル */
.macro-search-btn {
    background: #6b7280;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.macro-search-btn:hover {
    background: #84cc16;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(132, 204, 22, 0.3);
}

.macro-search-btn:active {
    transform: translateY(0);
}

/* モーダルオーバーレイ */
.macro-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.macro-modal-overlay.show {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

/* モーダルコンテンツ */
.macro-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s ease;
    border: 1px solid #e5e7eb;
}

.macro-modal-overlay.show .macro-modal {
    transform: scale(1);
}

/* モーダルヘッダー */
.macro-modal-header {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.macro-modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.macro-close-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
}

.macro-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* 検索入力フィールド */
.macro-search-container {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}

.macro-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    background: white;
}

.macro-search-input:focus {
    border-color: #84cc16;
    box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.1);
}

.macro-search-input::placeholder {
    color: #9ca3af;
}

/* リストコンテナ */
.macro-list-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 0;
    background: white;
}

/* リストアイテム */
.macro-list-item {
    display: flex;
    flex-direction: column;
    padding: 12px 20px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.15s ease;
}

.macro-list-item:hover {
    background: #f8f9fa;
    border-left: 3px solid #84cc16;
}

.macro-list-item.selected {
    background: #f0fdf4;
    border-left: 3px solid #84cc16;
    box-shadow: inset 0 0 0 1px rgba(132, 204, 22, 0.1);
}

.macro-list-item:last-child {
    border-bottom: none;
}

.macro-name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
    line-height: 1.3;
}

.macro-syntax {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: #f9fafb;
    padding: 8px 10px;
    border-radius: 4px;
    border-left: 3px solid #e5e7eb;
    word-break: break-all;
    line-height: 1.4;
}

.macro-list-item:hover .macro-syntax,
.macro-list-item.selected .macro-syntax {
    border-left-color: #84cc16;
    background: #f7fee7;
}

/* 結果なしメッセージ */
.macro-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 15px;
}

/* カスタムスクロールバー */
.macro-list-container::-webkit-scrollbar {
    width: 8px;
}

.macro-list-container::-webkit-scrollbar-track {
    background: #f9fafb;
}

.macro-list-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.macro-list-container::-webkit-scrollbar-thumb:hover {
    background: #84cc16;
}

/* 検索結果数表示 */
.macro-results-count {
    padding: 8px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .macro-modal {
        width: 95%;
        margin: 10px;
        border-radius: 6px;
        max-height: 90vh;
    }

    .macro-modal-header {
        padding: 12px 16px;
    }

    .macro-modal-title {
        font-size: 16px;
    }

    .macro-search-container {
        padding: 12px 16px;
    }

    .macro-search-input {
        padding: 8px 10px;
        font-size: 14px;
    }

    .macro-list-container {
        max-height: 400px;
    }

    .macro-list-item {
        padding: 10px 16px;
    }

    .macro-name {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .macro-syntax {
        font-size: 12px;
        padding: 6px 8px;
    }

    .macro-no-results {
        padding: 40px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .macro-modal {
        width: 98%;
        margin: 5px;
        max-height: 95vh;
    }

    .macro-modal-header {
        padding: 10px 12px;
    }

    .macro-modal-title {
        font-size: 15px;
    }

    .macro-search-container {
        padding: 10px 12px;
    }

    .macro-list-container {
        max-height: 350px;
    }

    .macro-list-item {
        padding: 8px 12px;
    }

    .macro-name {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .macro-syntax {
        font-size: 11px;
        padding: 5px 6px;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .macro-search-btn {
        background: #4b5563;
    }

    .macro-search-btn:hover {
        background: #84cc16;
    }

    .macro-modal {
        background: #1f2937;
        border-color: #374151;
    }

    .macro-modal-header {
        background: #111827;
        border-bottom-color: #374151;
        color: #f9fafb;
    }

    .macro-modal-title {
        color: #f9fafb;
    }

    .macro-close-btn {
        color: #9ca3af;
    }

    .macro-close-btn:hover {
        background: #374151;
        color: #f3f4f6;
    }

    .macro-search-container {
        background: #111827;
        border-bottom-color: #374151;
    }

    .macro-search-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }

    .macro-search-input:focus {
        border-color: #84cc16;
        box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.2);
    }

    .macro-search-input::placeholder {
        color: #6b7280;
    }

    .macro-list-container {
        background: #1f2937;
    }

    .macro-list-item {
        border-bottom-color: #374151;
    }

    .macro-list-item:hover {
        background: #374151;
        border-left-color: #84cc16;
    }

    .macro-list-item.selected {
        background: #1a2e05;
        border-left-color: #84cc16;
        box-shadow: inset 0 0 0 1px rgba(132, 204, 22, 0.2);
    }

    .macro-name {
        color: #f9fafb;
    }

    .macro-syntax {
        background: #111827;
        color: #d1d5db;
        border-left-color: #4b5563;
    }

    .macro-list-item:hover .macro-syntax,
    .macro-list-item.selected .macro-syntax {
        border-left-color: #84cc16;
        background: #1a2e05;
    }

    .macro-no-results {
        color: #9ca3af;
    }

    .macro-list-container::-webkit-scrollbar-track {
        background: #111827;
    }

    .macro-list-container::-webkit-scrollbar-thumb {
        background: #4b5563;
    }

    .macro-list-container::-webkit-scrollbar-thumb:hover {
        background: #84cc16;
    }

    .macro-results-count {
        background: #111827;
        border-bottom-color: #374151;
        color: #9ca3af;
    }
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .macro-modal {
        border: 2px solid #000;
    }

    .macro-search-input {
        border: 2px solid #000;
    }

    .macro-list-item {
        border-bottom: 1px solid #000;
    }

    .macro-list-item:hover,
    .macro-list-item.selected {
        background: #84cc16;
        color: #000;
    }

    .macro-syntax {
        border: 1px solid #000;
        background: #fff;
        color: #000;
    }
}

/* アニメーション無効化対応 */
@media (prefers-reduced-motion: reduce) {
    .macro-search-btn,
    .macro-modal-overlay,
    .macro-modal,
    .macro-close-btn,
    .macro-search-input,
    .macro-list-item {
        transition: none;
    }

    .macro-search-btn:hover {
        transform: none;
    }
}