/* ========================================
   検索ページ専用スタイル
   ======================================== */

/* リセット・ベース */
*, *::before, *::after {
    box-sizing: border-box;
}

body.search-page {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1e293b;
    background-color: #f8fafc;
    min-height: 100vh;
    padding-bottom: 140px; /* フッター分 */
}

/* ========================================
   ヘッダー
   ======================================== */
.search-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    max-width: 768px;
    margin: 0 auto;
}

.search-header-back {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #17858f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.search-header-back svg {
    width: 20px;
    height: 20px;
}

.search-header-logo img {
    display: block;
    height: 28px;
    width: auto;
}

.search-header-spacer {
    width: 60px;
}

/* ========================================
   メインコンテンツ
   ======================================== */
.search-main {
    padding: 16px;
}

.search-container {
    max-width: 768px;
    margin: 0 auto;
}

/* セクション */
.search-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.search-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
    padding-left: 12px;
    border-left: 4px solid #17858f;
}

/* ========================================
   勤務地セクション
   ======================================== */
.location-select-wrapper {
    width: 100%;
}

.location-select-wrapper select {
    width: 100%;
    padding: 12px 36px 12px 14px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background-color: #fff;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
}

.location-select-wrapper select:focus {
    outline: none;
    border-color: #17858f;
    box-shadow: 0 0 0 3px rgba(23, 133, 143, 0.1);
}

.location-select-wrapper select option {
    padding: 8px;
}

.location-select-wrapper select optgroup {
    font-weight: 700;
    color: #1e293b;
}

/* ========================================
   人気のこだわり条件
   ======================================== */
.popular-features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.popular-feature-btn {
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.popular-feature-btn:hover {
    border-color: #17858f;
    background: #f0fdfa;
}

.popular-feature-btn.selected {
    background: #17858f;
    border-color: #17858f;
    color: #fff;
}

/* ========================================
   アコーディオン（こだわり条件）
   ======================================== */
.accordion-item {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    background: #fff;
}

.accordion-item:last-child {
    margin-bottom: 0;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f8fafc;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    border: none;
    width: 100%;
    text-align: left;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: #f1f5f9;
}

.accordion-header-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.accordion-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #17858f;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 11px;
}

.accordion-count:empty {
    display: none;
}

.accordion-icon {
    font-size: 12px;
    color: #94a3b8;
    transition: transform 0.3s;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.active {
    max-height: 2000px;
}

.accordion-body {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
}

/* チェックボックスグループ */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 40px;
}

.checkbox-label:hover {
    background: #f0fdfa;
}

.checkbox-label.checked {
    background: #e0f7f9;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    background: #fff;
    pointer-events: none;
}

.checkbox-label.checked .checkbox-custom {
    background: #17858f;
    border-color: #17858f;
}

.checkbox-label.checked .checkbox-custom::after {
    content: '';
    width: 6px;
    height: 10px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.checkbox-text {
    font-size: 12px;
    color: #1e293b;
    line-height: 1.2;
    pointer-events: none;
}

/* ========================================
   フッター（固定）
   ======================================== */
.search-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.search-footer-inner {
    max-width: 768px;
    margin: 0 auto;
    padding: 12px 16px;
}

.search-selected-summary {
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 12px;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.search-selected-text {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.search-selected-summary.has-selection .search-selected-text {
    color: #17858f;
    font-weight: 600;
}

.search-footer-buttons {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
}

.search-clear-btn {
    padding: 14px 16px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.search-clear-btn:hover {
    border-color: #94a3b8;
    color: #475569;
}

.search-submit-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
}

.search-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(229, 57, 53, 0.4);
}

.search-submit-btn:active {
    transform: translateY(0);
}

/* ========================================
   レスポンシブ調整
   ======================================== */
@media (max-width: 768px) {
    body.search-page {
        padding-bottom: 160px;
    }

    .search-header-inner {
        padding: 10px 12px;
    }

    .search-main {
        padding: 12px;
    }

    .search-section {
        padding: 16px 12px;
        border-radius: 10px;
    }

    .search-section-title {
        font-size: 15px;
    }

    .search-footer-inner {
        padding: 10px 12px;
    }

    .search-footer-buttons {
        grid-template-columns: 90px 1fr;
        gap: 10px;
    }

    .search-clear-btn {
        padding: 12px 12px;
        font-size: 13px;
    }

    .search-submit-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* タップハイライト無効化 */
button, a, label {
    -webkit-tap-highlight-color: transparent;
}

/* スクロールバー（Chrome用） */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================
   ガイドテキスト（3つ制限）
   ======================================== */
.search-guide-text {
    text-align: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    color: #2e7d32;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* 検索ボタン内求人数表示 */
.search-submit-btn {
    white-space: nowrap;
}

.search-job-count-inline {
    margin-left: 4px;
    font-size: 13px;
    font-weight: 700;
}

.search-job-count-inline:empty {
    display: none;
}

/* チェックボックス・ボタン無効化（3つ制限） */
.checkbox-label.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.popular-feature-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}
