/* KMSP Gym Search - Responsive search UI */

.kmsp-search-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
}

/* ---------- Filter Form ---------- */

.kmsp-filter-form {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.kmsp-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.kmsp-filter-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.kmsp-filter-group input,
.kmsp-filter-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.kmsp-filter-group input:focus,
.kmsp-filter-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.kmsp-filter-group input::placeholder {
    color: #94a3b8;
}

.kmsp-filter-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.kmsp-btn {
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.kmsp-btn:active {
    transform: scale(0.97);
}

.kmsp-btn-primary {
    background: #3b82f6;
    color: #fff;
}

.kmsp-btn-primary:hover {
    background: #2563eb;
}

.kmsp-btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.kmsp-btn-secondary:hover {
    background: #cbd5e1;
}

/* ---------- Results Info ---------- */

.kmsp-results-info {
    padding: 12px 0;
    font-size: 15px;
    color: #475569;
    font-weight: 500;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.kmsp-results-info span {
    font-weight: 700;
    color: #3b82f6;
    font-size: 18px;
}

/* ---------- Loading ---------- */

.kmsp-loading {
    text-align: center;
    padding: 48px 0;
    color: #64748b;
}

.kmsp-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: kmsp-spin 0.8s linear infinite;
}

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

/* ---------- Results Grid ---------- */

.kmsp-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.kmsp-gym-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.kmsp-gym-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.kmsp-gym-card-header {
    margin-bottom: 12px;
}

.kmsp-gym-card-header h3 {
    margin: 0 0 6px;
    font-size: 17px;
    color: #1e293b;
    line-height: 1.3;
}

.kmsp-gym-card-header h3 a {
    color: inherit;
    text-decoration: none;
}

.kmsp-gym-card-header h3 a:hover {
    color: #3b82f6;
}

.kmsp-gym-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.kmsp-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.kmsp-tag-style {
    background: #fef3c7;
    color: #92400e;
}

.kmsp-tag-prefecture {
    background: #dbeafe;
    color: #1e40af;
}

.kmsp-gym-card-body {
    font-size: 14px;
    color: #475569;
    line-height: 1.7;
}

.kmsp-gym-card-body p {
    margin: 4px 0;
}

.kmsp-gym-card-body a {
    color: #3b82f6;
    text-decoration: none;
}

.kmsp-gym-card-body a:hover {
    text-decoration: underline;
}

.kmsp-rating {
    color: #f59e0b;
    font-weight: 600;
}

.kmsp-hours-toggle {
    display: inline-block;
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 0;
    font-weight: 500;
}

.kmsp-hours-detail {
    display: none;
    background: #f8fafc;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 4px;
    font-size: 13px;
    white-space: pre-line;
    line-height: 1.6;
}

.kmsp-hours-detail.open {
    display: block;
}

.kmsp-gym-card-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.kmsp-gym-card-footer a {
    font-size: 13px;
    font-weight: 500;
    color: #3b82f6;
    text-decoration: none;
}

.kmsp-gym-card-footer a:hover {
    text-decoration: underline;
}

/* ---------- No Results ---------- */

.kmsp-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 16px;
}

.kmsp-no-results-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ---------- Pagination ---------- */

.kmsp-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    padding-bottom: 32px;
    flex-wrap: wrap;
}

.kmsp-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.kmsp-page-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.kmsp-page-btn.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.kmsp-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .kmsp-filter-row {
        grid-template-columns: 1fr;
    }

    .kmsp-results-grid {
        grid-template-columns: 1fr;
    }

    .kmsp-filter-form {
        padding: 16px;
    }

    .kmsp-filter-actions {
        flex-direction: column;
    }

    .kmsp-btn {
        width: 100%;
    }
}
