﻿
/* Container */
.rice-search-container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.rice-search-container h1 {
    text-align: center;
    color: #0056b3;
    margin-bottom: 30px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.form-group:last-of-type {
    border-bottom: none;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

/* Select and Input Styling */
select, input[type=text], input[type=number] {
    width: calc(100% - 20px);
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
    margin-bottom: 10px;
}

input[type=radio] {
    margin-right: 5px;
}

.form-group label input[type=radio] {
    margin-left: 15px;
}

/* Taggable Input (contenteditable div) */
.taggable-input {
    min-height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 10px;
    background-color: #fff;
    cursor: text;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px; /* タグ間のスペース */
    margin-bottom: 10px;
}

.taggable-input:empty:before {
    content: attr(data-placeholder);
    color: #aaa;
}

.tag {
    background-color: #e0f2f7; /* Light blue */
    color: #007bff;
    border-radius: 4px;
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    font-size: 0.9em;
    white-space: nowrap;
}

.remove-tag {
    cursor: pointer;
    margin-left: 5px;
    font-weight: bold;
    color: #0056b3;
}

/* Buttons */
.button {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px;
}

.button:last-child {
    margin-right: 0;
}

.primary-button {
    background-color: #007bff;
    color: white;
}

.primary-button:hover {
    background-color: #0056b3;
}

.secondary-button {
    background-color: #6c757d;
    color: white;
}

.secondary-button:hover {
    background-color: #5a6268;
}

/* Popular Word/Option Buttons */
.popular-word-buttons,
.popular-region-buttons,
.popular-brand_name-buttons {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.add-tag-btn,
.select-option-btn {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    color: #333;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

.add-tag-btn:hover,
.select-option-btn:hover {
    background-color: #e0e0e0;
}

/* Spinner */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #007bff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px;
}

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

/* --- Styles for Button Groups (Quantities, Milling, Cultivation) --- */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* ボタンとボタンの間のスペース */
    margin-top: 5px;
    margin-bottom: 10px;
}

/* 各ボタンとヘルプアイコンを囲むラッパー */
.button-with-help {
    position: relative; /* ポップアップの位置決め基準 */
    display: flex;
    align-items: center; /* ボタンと？マークを中央揃え */
    gap: 5px; /* ボタンと？マークの間隔 */
}

.button-group .select-button {
    background-color: #e9ecef; /* Light gray */
    color: #495057;
    border: 1px solid #ced4da;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.2s ease;
    white-space: nowrap; /* ボタン内のテキストが改行されないように */
}

.button-group .select-button:hover {
    background-color: #dee2e6;
    border-color: #adb5bd;
}

.button-group .select-button.selected {
    background-color: #007bff; /* Primary blue */
    color: white;
    border-color: #007bff;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

/* --- Help Icon and Popup --- */
.help-icon {
    display: inline-flex; /* ?マークを丸くする */
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    font-size: 0.8em;
    font-weight: bold;
    cursor: pointer;
    flex-shrink: 0; /* 縮まないように */
}

.help-popup {
    position: absolute;
    top: calc(100% + 5px); /* 親要素（.button-with-help）の下部に表示 + 間隔 */
    left: 0;
    /* 左右のパディングを考慮してwidthを設定 */
    width: 200px; /* ポップアップの固定幅 */
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
    font-size: 0.85em; /* フォントサイズを少し小さく */
    line-height: 1.4;
    white-space: normal; /* テキストが折り返すように */
}


/* --- Fixed Search Info Bar --- */
#fixedSearchInfo {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

#fixedSearchInfo #resultCount {
    display: flex;
    align-items: center;
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin-right: 20px; /* ボタンとの間隔 */
    flex-grow: 1; /* スペースを埋める */
}

#fixedSearchInfo .button {
    margin-top: 5px;
    margin-bottom: 5px;
}

/* Responsive adjustments for fixed bar */
@media (max-width: 768px) {
    #fixedSearchInfo {
    		display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }
    #fixedSearchInfo #resultCount {
        margin-right: 0;
        margin-bottom: 10px;
    }
    #fixedSearchInfo .button {
        margin-right: 0;
    }
    /* ボタンとヘルプアイコンのグループを縦並びにする */
    .button-group {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    /* 個々のボタンとヘルプアイコンのペア */
    .button-with-help {
        width: 100%; /* 親の .button-group に合わせて幅を広げる */
        justify-content: flex-start; /* 左寄せ */
    }
    .help-popup {
        width: calc(100% - 20px); /* レスポンシブで幅を調整 */
    }
}

