/* 検索ページ専用CSS */
body {
    background: #f7f7fa;
    font-family: 'Yu Gothic', 'Meiryo', sans-serif;
    color: #222;
    margin: 0;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ローディング表示 */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.loading-content {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    min-width: 300px;
    transform: translateY(20px);
    animation: slideUp 0.4s ease forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2b7bb8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
    margin: 0 0 1.5rem 0;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.loading-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.progress-bar {
    width: 200px;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2b7bb8, #4a90e2);
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    box-shadow: 0 1px 3px rgba(43, 123, 184, 0.3);
}

.progress-text {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
    min-width: 40px;
    transition: all 0.3s ease;
}

/* 検索フォーム部分 */
.search-form-section {
    background: transparent;
    /* 白背景とボーダーを削除してスッキリさせる */
    margin-bottom: 2rem;
    padding: 0;
}

.search-form-section h1 {
    font-family: var(--font-sans, "Noto Sans JP", sans-serif);
    font-size: 1.75rem;
    font-weight: 600;
    color: #751485;
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #751485;
    letter-spacing: 0.02em;
}

.search-form-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.search-group h3 {
    font-size: 1.1rem;
    font-weight: bold;
    color: #22407a;
    margin-bottom: 12px;
}

/* 検索入力ボックス（仮） */
.search-input-placeholder {
    background: #f6f6f6;
    border: 2px dashed #b0b8d8;
    border-radius: 8px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #556;
    font-weight: 600;
}

/* チェックボックスエリア（仮） */
.search-checkbox-placeholder {
    background: #f6f6f6;
    border: 2px dashed #b0b8d8;
    border-radius: 8px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #556;
    text-align: center;
    padding: 12px;
}

/* 検索ボタン（仮） */
.search-button-placeholder {
    width: 220px;
    height: 48px;
    background: #2b7bb8;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1.15rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(30, 60, 120, 0.07);
    transition: background 0.2s;
}

.search-button-placeholder:hover {
    background: #174a7a;
}

/* 検索結果部分 */
.search-results-section {
    background: transparent;
    padding: 0;
}

.search-results-section h2 {
    font-family: var(--font-sans, "Noto Sans JP", sans-serif);
    font-size: 1.75rem;
    font-weight: 600;
    color: #751485;
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #751485;
    letter-spacing: 0.02em;
}

/* 結果件数表示（仮） */
.results-count-placeholder {
    background: transparent;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 1.1rem;
    color: #223;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

/* 結果一覧エリア（仮） */
.results-list-placeholder {
    background: #f6f6f6;
    border: 2px dashed #b0b8d8;
    border-radius: 8px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #556;
    font-weight: 600;
    margin-bottom: 24px;
}

/* ページネーション（仮） */
.pagination-placeholder {
    background: transparent;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #556;
    font-weight: 600;
}

.search-button-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* 検索フォームのinput, select, buttonの統一スタイル */
.search-form-container input[type="text"],
.search-form-container select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    font-size: 1rem;
    border: 1.5px solid #b0b8d8;
    border-radius: 8px;
    margin-top: 6px;
    margin-bottom: 0;
    box-sizing: border-box;
    background: #f6f6f6;
    color: #223;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* プルダウンメニューのスクロール設定 */
.search-form-container select {
    max-height: 150px;
    overflow-y: auto;
}

/* optgroupのスタイル */
.search-form-container select optgroup {
    font-weight: bold;
    color: #2b7bb8;
    background: #f5f7fa;
}

.search-form-container select option {
    padding: 4px 8px;
    font-weight: normal;
    color: #333;
}

/* スクロールバーのスタイル */
.search-form-container select::-webkit-scrollbar {
    width: 8px;
}

.search-form-container select::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.search-form-container select::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.search-form-container select::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.search-form-container input[type="text"]:focus,
.search-form-container select:focus {
    outline: none;
    border-color: #2b7bb8;
    box-shadow: 0 0 0 2px rgba(43, 123, 184, 0.25);
    background: #fff;
}

.search-form-container label {
    font-weight: bold;
    color: #223;
    /* カラーを黒に変更 */
    margin-bottom: 4px;
    display: block;
}

.search-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0;
}

/* 検索ボタンとクリアボタン - サイト全体のデザインに合わせる */
.search-button,
.clear-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    height: 44px;
    text-decoration: none;
    border: none;
    box-sizing: border-box;
}

.search-button {
    background: #751485;
    color: #fff;
    box-shadow: 0 6px 24px rgba(34, 36, 38, 0.06);
}

.search-button:hover {
    background: #5e106a;
    transform: translateY(-1px);
    box-shadow: 0 8px 32px rgba(34, 36, 38, 0.12);
}

.clear-button {
    background: transparent;
    color: #751485;
    border: 1.5px solid #e7d3eb;
}

.clear-button:hover {
    background: #f6eef8;
    color: #5e106a;
    border-color: #d4b8db;
    transform: translateY(-1px);
}

/* 検索結果のキーワードハイライト */
.highlight {
    font-weight: bold;
    color: #d32f2f;
    background: #fffbe6;
    padding: 2px 4px;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 検索結果セクションのスタイル */
.search-results-section {
    margin-top: 3rem;
    padding: 0;
    background: transparent;
}

.search-results-section h2 {
    font-family: var(--font-sans, "Noto Sans JP", sans-serif);
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #751485;
    color: #751485;
}

.results-count-placeholder {
    font-size: 1.1rem;
    font-weight: 600;
    color: #223;
    margin-bottom: 1.5rem;
    padding: 0;
    background: transparent;
    border: none;
}

/* テーブルのスタイル - list-page.cssのdata-tableスタイルに合わせる */
.results-table-placeholder {
    margin: 1.5rem 0;
}

.results-table-placeholder .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #beb8c2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-radius: 14px;
}

.results-table-placeholder table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9375rem;
    background: #fff;
}

.results-table-placeholder th,
.results-table-placeholder td {
    padding: 1rem 1.25rem;
    text-align: center;
    vertical-align: middle;
    /* 垂直方向中央揃えに変更 */
    border-bottom: 1px solid #e5e1e8;
    border-left: 1px solid #e5e1e8;
}

/* カラム幅の調整: 種名(1), 学名(2), 分類(3), カテゴリー(4), 地域(5) */
.results-table-placeholder th:nth-child(2) {
    width: 33%;
}

.results-table-placeholder th:nth-child(3) {
    width: 12%;
}

.results-table-placeholder th:nth-child(5) {
    width: 15%;
}

.results-table-placeholder th:first-child,
.results-table-placeholder td:first-child {
    border-left: none;
}

.results-table-placeholder thead th {
    background: #f6eef8;
    color: #751485;
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 2px solid #751485;
}

.results-table-placeholder tbody tr:nth-child(even) {
    background-color: #faf9fb;
}

.results-table-placeholder tbody tr:hover {
    background-color: #f6eef8;
}

.results-table-placeholder tbody tr:last-child th,
.results-table-placeholder tbody tr:last-child td {
    border-bottom: none;
}

.results-table-placeholder .species-name {
    color: #751485;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.results-table-placeholder .species-name:hover {
    color: #5e106a;
    text-decoration: underline;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 24px 0;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.pagination-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.pagination-btn.current-page {
    background: #751485;
    color: #fff;
    border-color: #751485;
}

.pagination-btn.prev-btn,
.pagination-btn.next-btn {
    font-weight: bold;
}

.pagination-ellipsis {
    color: #6c757d;
    padding: 8px 4px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .search-form-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .search-form-section,
    .search-results-section {
        padding: 18px 8px;
    }

    main {
        padding: 1rem 0.5rem;
    }

    .results-table-placeholder table {
        font-size: 0.95rem;
    }

    .results-table-placeholder th,
    .results-table-placeholder td {
        padding: 8px 4px;
    }

    .search-button-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-button,
    .clear-button {
        width: 100%;
        min-width: auto;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 4px;
    }

    .pagination-btn {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
}