/**
 * Simple Coordinate Map - Search Styles
 * Version: 1.3.0
 */

/* 検索フォームのラッパー */
.map-search-form-wrapper {
    /* position: relative;
    margin-bottom: 20px;
    max-width: 100%; */
    position: relative;
    padding-block: 10px 20px;
}

.map-search-form-wrapper::before {
    content: "";
    position: absolute;
    background-image: url(../../assets/img/search.png);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 20px;
    height: 20px;
    left: 7px;
    top: 43%;
    transform: translateY(-50%);
}

/* 検索フォーム */
.map-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 検索入力フィールド */
.map-search-input {
    background-color: #ededed;
    border: none;
    color: #333333;
    border-radius: 5px;
    padding-block: 10px;
    padding-inline: 30px 10px;
    width: 100%;
    height: 40px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    outline: #666666;
}

.map-search-input:focus {
    border-color: #47c59f;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.map-search-input::placeholder {
    color: #999;
}

/* クリアボタン */
.scm-clear-search {
    position: absolute;
    right: 12px;
    top: 45%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    display: none;
    transition: color 0.2s ease;
}

.scm-clear-search:hover {
    color: #333;
}

.scm-clear-search:focus {
    outline: 2px solid #47c59f;
    outline-offset: 2px;
}

/* 検索結果情報 */
.scm-search-result-info {
    margin-bottom: 12px;
    padding-inline: 12px;
    /* background-color: #f5f5f5; */
    /* border-left: 4px solid #47c59f; */
    border-radius: 4px;
    display: none;
}

.scm-search-result-info p {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.scm-result-count {
    font-weight: bold;
    color: #47c59f;
}

/* ローディング状態 */
.searchable-map.scm-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.searchable-map.scm-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #47c59f;
    border-radius: 50%;
    animation: scm-spin 1s linear infinite;
    z-index: 1000;
}

@keyframes scm-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* レスポンシブデザイン */
/* @media screen and (max-width: 768px) {
    .map-search-input {
        padding: 10px 36px 10px 12px;
        font-size: 14px;
    }

    .scm-clear-search {
        right: 8px;
        font-size: 20px;
        width: 20px;
        height: 20px;
        line-height: 20px;
    }

    .scm-search-result-info {
        padding: 6px 10px;
    }

    .scm-search-result-info p {
        font-size: 13px;
    }
} */

/* 検索フォームのバリエーション（カスタマイズ用） */
.map-search-form.compact .map-search-input {
    padding: 8px 32px 8px 12px;
    font-size: 14px;
}

.map-search-form.large .map-search-input {
    padding: 16px 48px 16px 20px;
    font-size: 18px;
}

/* ダークモード対応（オプション） */
@media (prefers-color-scheme: dark) {
    .map-search-input {
        background-color: #2c2c2c;
        border-color: #444;
        color: #fff;
    }

    .map-search-input:focus {
        border-color: #5a9fd4;
        box-shadow: 0 0 0 3px rgba(90, 159, 212, 0.2);
    }

    .map-search-input::placeholder {
        color: #888;
    }

    .scm-clear-search {
        color: #999;
    }

    .scm-clear-search:hover {
        color: #fff;
    }

    .scm-search-result-info {
        background-color: #2c2c2c;
        border-left-color: #5a9fd4;
    }

    .scm-search-result-info p {
        color: #ddd;
    }

    .scm-result-count {
        color: #5a9fd4;
    }
}

/* アクセシビリティ対応 */
.map-search-input:focus-visible {
    outline: 2px solid #666666;
    outline-offset: 2px;
}

/* アニメーション */
.scm-search-result-info {
    animation: scm-fade-in 0.3s ease;
}

@keyframes scm-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}